Merge lp:~evfool/synaptic/jumpingtree into lp:synaptic
- jumpingtree
- Merge into trunk
Proposed by
Robert Roth
| Status: | Merged |
|---|---|
| Merged at revision: | 2110 |
| Proposed branch: | lp:~evfool/synaptic/jumpingtree |
| Merge into: | lp:synaptic |
| Diff against target: |
285 lines (+82/-58) 2 files modified
gtk/gtkbuilder/dialog_welcome.ui (+77/-55) gtk/rgmainwindow.cc (+5/-3) |
| To merge this branch: | bzr merge lp:~evfool/synaptic/jumpingtree |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Michael Vogt | Pending | ||
|
Review via email:
|
|||
Commit message
Description of the change
Here's a fix/workaround for the tree jumping around, along with a fix for the welcome dialog (which somehow got messed up with gtk3 - spacing issues in the dialog, I've seen lots of these with gtk3).
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
| 1 | === modified file 'gtk/gtkbuilder/dialog_welcome.ui' |
| 2 | --- gtk/gtkbuilder/dialog_welcome.ui 2012-10-17 20:05:41 +0000 |
| 3 | +++ gtk/gtkbuilder/dialog_welcome.ui 2012-11-22 11:55:47 +0000 |
| 4 | @@ -135,29 +135,14 @@ |
| 5 | </packing> |
| 6 | </child> |
| 7 | <child> |
| 8 | - <object class="GtkTable" id="table1"> |
| 9 | + <object class="GtkGrid" id="grid1"> |
| 10 | <property name="visible">True</property> |
| 11 | <property name="can_focus">False</property> |
| 12 | - <property name="n_rows">4</property> |
| 13 | - <property name="n_columns">2</property> |
| 14 | - <property name="row_spacing">6</property> |
| 15 | - <child> |
| 16 | - <object class="GtkLabel" id="label19"> |
| 17 | - <property name="visible">True</property> |
| 18 | - <property name="can_focus">False</property> |
| 19 | - <property name="xalign">0</property> |
| 20 | - <property name="yalign">0</property> |
| 21 | - <property name="label" translatable="yes"> - </property> |
| 22 | - </object> |
| 23 | - <packing> |
| 24 | - <property name="x_options">GTK_FILL</property> |
| 25 | - <property name="y_options">GTK_FILL</property> |
| 26 | - </packing> |
| 27 | - </child> |
| 28 | <child> |
| 29 | <object class="GtkLabel" id="label23"> |
| 30 | <property name="visible">True</property> |
| 31 | <property name="can_focus">False</property> |
| 32 | + <property name="valign">start</property> |
| 33 | <property name="xalign">0</property> |
| 34 | <property name="yalign">0</property> |
| 35 | <property name="label" translatable="yes">Select the package and choose the action from the 'Package' menu.</property> |
| 36 | @@ -166,14 +151,16 @@ |
| 37 | </object> |
| 38 | <packing> |
| 39 | <property name="left_attach">1</property> |
| 40 | - <property name="right_attach">2</property> |
| 41 | - <property name="y_options"/> |
| 42 | + <property name="top_attach">0</property> |
| 43 | + <property name="width">1</property> |
| 44 | + <property name="height">1</property> |
| 45 | </packing> |
| 46 | </child> |
| 47 | <child> |
| 48 | <object class="GtkLabel" id="label24"> |
| 49 | <property name="visible">True</property> |
| 50 | <property name="can_focus">False</property> |
| 51 | + <property name="valign">start</property> |
| 52 | <property name="xalign">0</property> |
| 53 | <property name="yalign">0</property> |
| 54 | <property name="label" translatable="yes">Double click on the package name.</property> |
| 55 | @@ -182,16 +169,16 @@ |
| 56 | </object> |
| 57 | <packing> |
| 58 | <property name="left_attach">1</property> |
| 59 | - <property name="right_attach">2</property> |
| 60 | <property name="top_attach">1</property> |
| 61 | - <property name="bottom_attach">2</property> |
| 62 | - <property name="y_options"/> |
| 63 | + <property name="width">1</property> |
| 64 | + <property name="height">1</property> |
| 65 | </packing> |
| 66 | </child> |
| 67 | <child> |
| 68 | <object class="GtkLabel" id="label25"> |
| 69 | <property name="visible">True</property> |
| 70 | <property name="can_focus">False</property> |
| 71 | + <property name="valign">start</property> |
| 72 | <property name="xalign">0</property> |
| 73 | <property name="yalign">0</property> |
| 74 | <property name="label" translatable="yes">Choose the action from the context menu of the package.</property> |
| 75 | @@ -200,16 +187,16 @@ |
| 76 | </object> |
| 77 | <packing> |
| 78 | <property name="left_attach">1</property> |
| 79 | - <property name="right_attach">2</property> |
| 80 | <property name="top_attach">2</property> |
| 81 | - <property name="bottom_attach">3</property> |
| 82 | - <property name="y_options"/> |
| 83 | + <property name="width">1</property> |
| 84 | + <property name="height">1</property> |
| 85 | </packing> |
| 86 | </child> |
| 87 | <child> |
| 88 | <object class="GtkLabel" id="label26"> |
| 89 | <property name="visible">True</property> |
| 90 | <property name="can_focus">False</property> |
| 91 | + <property name="valign">start</property> |
| 92 | <property name="xalign">0</property> |
| 93 | <property name="yalign">0</property> |
| 94 | <property name="label" translatable="yes">Click on the status icon to open a menu that contains all actions.</property> |
| 95 | @@ -218,61 +205,94 @@ |
| 96 | </object> |
| 97 | <packing> |
| 98 | <property name="left_attach">1</property> |
| 99 | - <property name="right_attach">2</property> |
| 100 | <property name="top_attach">3</property> |
| 101 | - <property name="bottom_attach">4</property> |
| 102 | - <property name="x_options">GTK_FILL</property> |
| 103 | - <property name="y_options">GTK_EXPAND</property> |
| 104 | - </packing> |
| 105 | - </child> |
| 106 | - <child> |
| 107 | - <object class="GtkLabel" id="label20"> |
| 108 | - <property name="visible">True</property> |
| 109 | - <property name="can_focus">False</property> |
| 110 | - <property name="xalign">0</property> |
| 111 | - <property name="yalign">0</property> |
| 112 | - <property name="label" translatable="yes"> - </property> |
| 113 | - </object> |
| 114 | - <packing> |
| 115 | + <property name="width">1</property> |
| 116 | + <property name="height">1</property> |
| 117 | + </packing> |
| 118 | + </child> |
| 119 | + <child> |
| 120 | + <object class="GtkLabel" id="label1"> |
| 121 | + <property name="visible">True</property> |
| 122 | + <property name="can_focus">False</property> |
| 123 | + <property name="halign">start</property> |
| 124 | + <property name="valign">start</property> |
| 125 | + <property name="xalign">0</property> |
| 126 | + <property name="yalign">0</property> |
| 127 | + <property name="xpad">6</property> |
| 128 | + <property name="label" translatable="yes">-</property> |
| 129 | + <property name="justify">fill</property> |
| 130 | + <property name="wrap">True</property> |
| 131 | + </object> |
| 132 | + <packing> |
| 133 | + <property name="left_attach">0</property> |
| 134 | + <property name="top_attach">0</property> |
| 135 | + <property name="width">1</property> |
| 136 | + <property name="height">1</property> |
| 137 | + </packing> |
| 138 | + </child> |
| 139 | + <child> |
| 140 | + <object class="GtkLabel" id="label2"> |
| 141 | + <property name="visible">True</property> |
| 142 | + <property name="can_focus">False</property> |
| 143 | + <property name="halign">start</property> |
| 144 | + <property name="valign">start</property> |
| 145 | + <property name="xalign">0</property> |
| 146 | + <property name="yalign">0</property> |
| 147 | + <property name="xpad">6</property> |
| 148 | + <property name="label" translatable="yes">-</property> |
| 149 | + <property name="justify">fill</property> |
| 150 | + <property name="wrap">True</property> |
| 151 | + </object> |
| 152 | + <packing> |
| 153 | + <property name="left_attach">0</property> |
| 154 | <property name="top_attach">1</property> |
| 155 | - <property name="bottom_attach">2</property> |
| 156 | - <property name="x_options">GTK_FILL</property> |
| 157 | - <property name="y_options">GTK_FILL</property> |
| 158 | + <property name="width">1</property> |
| 159 | + <property name="height">1</property> |
| 160 | </packing> |
| 161 | </child> |
| 162 | <child> |
| 163 | - <object class="GtkLabel" id="label21"> |
| 164 | + <object class="GtkLabel" id="label3"> |
| 165 | <property name="visible">True</property> |
| 166 | <property name="can_focus">False</property> |
| 167 | + <property name="halign">start</property> |
| 168 | + <property name="valign">start</property> |
| 169 | <property name="xalign">0</property> |
| 170 | <property name="yalign">0</property> |
| 171 | - <property name="label" translatable="yes"> - </property> |
| 172 | + <property name="xpad">6</property> |
| 173 | + <property name="label" translatable="yes">-</property> |
| 174 | + <property name="justify">fill</property> |
| 175 | + <property name="wrap">True</property> |
| 176 | </object> |
| 177 | <packing> |
| 178 | + <property name="left_attach">0</property> |
| 179 | <property name="top_attach">2</property> |
| 180 | - <property name="bottom_attach">3</property> |
| 181 | - <property name="x_options">GTK_FILL</property> |
| 182 | - <property name="y_options">GTK_FILL</property> |
| 183 | + <property name="width">1</property> |
| 184 | + <property name="height">1</property> |
| 185 | </packing> |
| 186 | </child> |
| 187 | <child> |
| 188 | - <object class="GtkLabel" id="label22"> |
| 189 | + <object class="GtkLabel" id="label4"> |
| 190 | <property name="visible">True</property> |
| 191 | <property name="can_focus">False</property> |
| 192 | + <property name="halign">start</property> |
| 193 | + <property name="valign">start</property> |
| 194 | <property name="xalign">0</property> |
| 195 | <property name="yalign">0</property> |
| 196 | - <property name="label" translatable="yes"> - </property> |
| 197 | + <property name="xpad">6</property> |
| 198 | + <property name="label" translatable="yes">-</property> |
| 199 | + <property name="justify">fill</property> |
| 200 | + <property name="wrap">True</property> |
| 201 | </object> |
| 202 | <packing> |
| 203 | + <property name="left_attach">0</property> |
| 204 | <property name="top_attach">3</property> |
| 205 | - <property name="bottom_attach">4</property> |
| 206 | - <property name="x_options">GTK_FILL</property> |
| 207 | - <property name="y_options">GTK_FILL</property> |
| 208 | + <property name="width">1</property> |
| 209 | + <property name="height">1</property> |
| 210 | </packing> |
| 211 | </child> |
| 212 | </object> |
| 213 | <packing> |
| 214 | - <property name="expand">False</property> |
| 215 | + <property name="expand">True</property> |
| 216 | <property name="fill">True</property> |
| 217 | <property name="position">4</property> |
| 218 | </packing> |
| 219 | @@ -290,6 +310,7 @@ |
| 220 | <property name="visible">True</property> |
| 221 | <property name="can_focus">True</property> |
| 222 | <property name="receives_default">False</property> |
| 223 | + <property name="valign">end</property> |
| 224 | <property name="use_underline">True</property> |
| 225 | <property name="xalign">0.5</property> |
| 226 | <property name="draw_indicator">True</property> |
| 227 | @@ -297,6 +318,7 @@ |
| 228 | <packing> |
| 229 | <property name="expand">False</property> |
| 230 | <property name="fill">False</property> |
| 231 | + <property name="pack_type">end</property> |
| 232 | <property name="position">1</property> |
| 233 | </packing> |
| 234 | </child> |
| 235 | @@ -309,7 +331,7 @@ |
| 236 | </child> |
| 237 | </object> |
| 238 | <packing> |
| 239 | - <property name="expand">False</property> |
| 240 | + <property name="expand">True</property> |
| 241 | <property name="fill">True</property> |
| 242 | <property name="position">1</property> |
| 243 | </packing> |
| 244 | |
| 245 | === modified file 'gtk/rgmainwindow.cc' |
| 246 | --- gtk/rgmainwindow.cc 2012-11-21 18:52:17 +0000 |
| 247 | +++ gtk/rgmainwindow.cc 2012-11-22 11:55:47 +0000 |
| 248 | @@ -317,7 +317,6 @@ |
| 249 | _pkgList = GTK_TREE_MODEL(gtk_pkg_list_new(_lister)); |
| 250 | gtk_tree_view_set_model(GTK_TREE_VIEW(_treeView), |
| 251 | GTK_TREE_MODEL(_pkgList)); |
| 252 | - |
| 253 | if(setAdjustment) { |
| 254 | gtk_adjustment_value_changed( |
| 255 | gtk_tree_view_get_hadjustment(GTK_TREE_VIEW(_treeView))); |
| 256 | @@ -329,10 +328,11 @@ |
| 257 | if(selectedPkg != NULL) { |
| 258 | GtkTreeIter iter; |
| 259 | RPackage *pkg; |
| 260 | - |
| 261 | + GtkTreePath *start = gtk_tree_path_new(); |
| 262 | // make sure we have the keyboard focus after the refresh |
| 263 | gtk_widget_grab_focus(_treeView); |
| 264 | |
| 265 | + gtk_tree_view_get_visible_range(GTK_TREE_VIEW(_treeView), &start, NULL); |
| 266 | // find and select the pkg we are looking for |
| 267 | bool ok = gtk_tree_model_get_iter_first(_pkgList, &iter); |
| 268 | while(ok) { |
| 269 | @@ -340,13 +340,15 @@ |
| 270 | if(pkg == selectedPkg) { |
| 271 | GtkTreePath* path = gtk_tree_model_get_path(_pkgList, &iter); |
| 272 | gtk_tree_view_set_cursor(GTK_TREE_VIEW(_treeView), path, |
| 273 | - NULL, false); |
| 274 | + NULL, false); |
| 275 | gtk_tree_path_free(path); |
| 276 | break; |
| 277 | } |
| 278 | |
| 279 | ok = gtk_tree_model_iter_next(_pkgList, &iter); |
| 280 | } |
| 281 | + gtk_tree_view_scroll_to_cell(GTK_TREE_VIEW(_treeView), start, NULL, true, 0.0, 0.0); |
| 282 | + gtk_tree_path_free(start); |
| 283 | } |
| 284 | |
| 285 | setStatusText(); |