Merge lp:~agateau/gnome-control-center/category-headers into lp:~ubuntu-desktop/gnome-control-center/ubuntu

Proposed by Aurélien Gâteau
Status: Merged
Merged at revision: 336
Proposed branch: lp:~agateau/gnome-control-center/category-headers
Merge into: lp:~ubuntu-desktop/gnome-control-center/ubuntu
Diff against target: 243 lines (+173/-7)
2 files modified
debian/patches/58_ubuntu_icon_views_redesign.patch (+172/-6)
debian/patches/series (+1/-1)
To merge this branch: bzr merge lp:~agateau/gnome-control-center/category-headers
Reviewer Review Type Date Requested Status
Didier Roche-Tolomelli Approve
Review via email: mp+91684@code.launchpad.net

Description of the change

This branch reworks the category headers patch: it changes the icon size of
icons in the categories to 48x48 and makes sure the window is always correctly
sized. If the screen is not tall enough, the window gets maximized.

To post a comment you must log in.
Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

waow, it's really big! but working well, thanks! Merging.

Btw, the default screen size is still a little bit small compared to what's needed, just a gentle reminder that needs to be fixed :)

review: Approve
Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

waow, it's really big! but working well, thanks! Merging.

Btw, the default screen size is still a little bit small compared to what's needed, just a gentle reminder that needs to be fixed :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== renamed file 'debian/patches/58_ubuntu_category_headers_redesign.patch' => 'debian/patches/58_ubuntu_icon_views_redesign.patch'
2--- debian/patches/58_ubuntu_category_headers_redesign.patch 2012-01-24 17:15:29 +0000
3+++ debian/patches/58_ubuntu_icon_views_redesign.patch 2012-02-06 17:21:06 +0000
4@@ -128,10 +128,42 @@
5 CcShellItemView* cc_shell_category_view_get_item_view (CcShellCategoryView *self);
6
7
8+=== modified file 'shell/cc-shell-model.c'
9+--- old/shell/cc-shell-model.c 2012-01-19 14:14:30 +0000
10++++ new/shell/cc-shell-model.c 2012-02-06 16:50:49 +0000
11+@@ -43,7 +43,7 @@
12+ theme = gtk_icon_theme_get_default ();
13+
14+ icon_info = gtk_icon_theme_lookup_by_gicon (theme, icon,
15+- 32, GTK_ICON_LOOKUP_FORCE_SIZE);
16++ 48, GTK_ICON_LOOKUP_FORCE_SIZE);
17+ if (icon_info)
18+ {
19+ pixbuf = gtk_icon_info_load_icon (icon_info, &err);
20+
21 === modified file 'shell/gnome-control-center.c'
22 --- old/shell/gnome-control-center.c 2012-01-19 14:14:30 +0000
23-+++ new/shell/gnome-control-center.c 2012-01-24 16:25:58 +0000
24-@@ -303,7 +303,8 @@
25++++ new/shell/gnome-control-center.c 2012-02-06 16:51:44 +0000
26+@@ -48,7 +48,8 @@
27+ * for the user than resizing vertically
28+ * Both sizes are defined in https://live.gnome.org/Design/SystemSettings/ */
29+ #define FIXED_WIDTH 740
30+-#define FIXED_HEIGHT 530
31++#define FIXED_HEIGHT 618
32++#define SMALL_SCREEN_FIXED_HEIGHT 500
33+
34+ #define MIN_ICON_VIEW_HEIGHT 300
35+
36+@@ -85,6 +86,8 @@
37+
38+ gchar *default_window_title;
39+ gchar *default_window_icon;
40++
41++ gboolean small_screen;
42+ };
43+
44+ static const gchar *
45+@@ -303,7 +306,8 @@
46 res = NULL;
47 for (l = list; l; l = l->next)
48 {
49@@ -141,7 +173,26 @@
50 }
51
52 g_list_free (list);
53-@@ -643,7 +644,8 @@
54+@@ -576,6 +580,8 @@
55+ static void
56+ setup_search (GnomeControlCenter *shell)
57+ {
58++ int margin = 12;
59++ int spacing = 6;
60+ GtkWidget *search_scrolled, *search_view, *widget;
61+ GnomeControlCenterPrivate *priv = shell->priv;
62+
63+@@ -594,7 +600,8 @@
64+ priv->search_view = search_view = cc_shell_item_view_new ();
65+ gtk_icon_view_set_item_orientation (GTK_ICON_VIEW (search_view),
66+ GTK_ORIENTATION_HORIZONTAL);
67+- gtk_icon_view_set_spacing (GTK_ICON_VIEW (search_view), 6);
68++ gtk_icon_view_set_margin (GTK_ICON_VIEW (search_view), margin);
69++ gtk_icon_view_set_spacing (GTK_ICON_VIEW (search_view), spacing);
70+ gtk_icon_view_set_model (GTK_ICON_VIEW (search_view),
71+ GTK_TREE_MODEL (priv->search_filter));
72+ gtk_icon_view_set_pixbuf_column (GTK_ICON_VIEW (search_view), COL_PIXBUF);
73+@@ -643,7 +650,8 @@
74
75 static void
76 maybe_add_category_view (GnomeControlCenter *shell,
77@@ -151,7 +202,7 @@
78 {
79 GtkTreeModel *filter;
80 GtkWidget *categoryview;
81-@@ -651,6 +653,15 @@
82+@@ -651,6 +659,16 @@
83 if (g_hash_table_lookup (shell->priv->category_views, name) != NULL)
84 return;
85
86@@ -159,6 +210,7 @@
87 + {
88 + GtkWidget *separator;
89 + separator = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
90++ gtk_widget_set_margin_top (separator, 11);
91 + gtk_widget_set_margin_bottom (separator, 10);
92 + gtk_box_pack_start (GTK_BOX (shell->priv->main_vbox), separator, FALSE, FALSE, 0);
93 + gtk_widget_show (separator);
94@@ -167,7 +219,7 @@
95 /* create new category view for this category */
96 filter = gtk_tree_model_filter_new (GTK_TREE_MODEL (shell->priv->store),
97 NULL);
98-@@ -658,7 +669,7 @@
99+@@ -658,7 +676,7 @@
100 (GtkTreeModelFilterVisibleFunc) category_filter_func,
101 g_strdup (name), g_free);
102
103@@ -176,7 +228,7 @@
104 gtk_box_pack_start (GTK_BOX (shell->priv->main_vbox), categoryview, FALSE, TRUE, 0);
105
106 g_signal_connect (cc_shell_category_view_get_item_view (CC_SHELL_CATEGORY_VIEW (categoryview)),
107-@@ -706,13 +717,15 @@
108+@@ -706,13 +724,15 @@
109 {
110 GMenuTreeDirectory *subdir;
111 const gchar *dir_name;
112@@ -193,4 +245,118 @@
113
114 /* add the items from this category to the model */
115 sub_iter = gmenu_tree_directory_iter (subdir);
116+@@ -749,7 +769,10 @@
117+ {
118+ GnomeControlCenterPrivate *priv = shell->priv;
119+
120+- gtk_container_set_border_width (GTK_CONTAINER (shell->priv->main_vbox), 10);
121++ gtk_widget_set_margin_top( shell->priv->main_vbox, 8);
122++ gtk_widget_set_margin_bottom( shell->priv->main_vbox, 8);
123++ gtk_widget_set_margin_left( shell->priv->main_vbox, 12);
124++ gtk_widget_set_margin_right( shell->priv->main_vbox, 12);
125+ gtk_container_set_focus_vadjustment (GTK_CONTAINER (shell->priv->main_vbox),
126+ gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (shell->priv->scrolled_window)));
127+
128+@@ -806,7 +829,10 @@
129+ gtk_widget_hide (W (priv->builder, "home-button"));
130+ gtk_widget_show (W (priv->builder, "search-entry"));
131+ gtk_widget_hide (W (priv->builder, "lock-button"));
132+- gtk_scrolled_window_set_min_content_height (GTK_SCROLLED_WINDOW (priv->scrolled_window), FIXED_HEIGHT - 50);
133++ gtk_scrolled_window_set_min_content_height (GTK_SCROLLED_WINDOW (priv->scrolled_window),
134++ (priv->small_screen
135++ ? SMALL_SCREEN_FIXED_HEIGHT
136++ : FIXED_HEIGHT) - 50 );
137+ }
138+ else
139+ {
140+@@ -1068,6 +1094,23 @@
141+ return retval;
142+ }
143+
144++static gint
145++get_monitor_height (void)
146++{
147++ GdkScreen *screen;
148++ gint x, y;
149++ GdkRectangle rect;
150++ GdkDisplay *display = gdk_display_get_default ();
151++ GdkDeviceManager *device_manager = gdk_display_get_device_manager (display);
152++ GdkDevice *device = gdk_device_manager_get_client_pointer (device_manager);
153++
154++ gdk_device_get_position (device, &screen, &x, &y);
155++
156++ gint monitor = gdk_screen_get_monitor_at_point (screen, x, y);
157++ gdk_screen_get_monitor_geometry (screen, monitor, &rect);
158++ return rect.height;
159++}
160++
161+ static void
162+ gnome_control_center_init (GnomeControlCenter *self)
163+ {
164+@@ -1077,6 +1120,8 @@
165+
166+ priv = self->priv = CONTROL_CENTER_PRIVATE (self);
167+
168++ priv->small_screen = get_monitor_height() <= FIXED_HEIGHT;
169++
170+ /* load the user interface */
171+ priv->builder = gtk_builder_new ();
172+
173+@@ -1090,6 +1135,8 @@
174+
175+ /* connect various signals */
176+ priv->window = W (priv->builder, "main-window");
177++ if (priv->small_screen)
178++ gtk_window_set_resizable (GTK_WINDOW (priv->window), TRUE);
179+ g_signal_connect_swapped (priv->window, "delete-event", G_CALLBACK (g_object_unref), self);
180+ g_signal_connect (priv->window, "key_press_event",
181+ G_CALLBACK (window_key_press_event), self);
182+@@ -1136,6 +1183,9 @@
183+ void
184+ gnome_control_center_present (GnomeControlCenter *center)
185+ {
186++ if (center->priv->small_screen) {
187++ gtk_window_maximize (GTK_WINDOW (center->priv->window));
188++ }
189+ gtk_window_present (GTK_WINDOW (center->priv->window));
190+ }
191+
192+
193+=== modified file 'shell/shell-search-renderer.c'
194+--- old/shell/shell-search-renderer.c 2012-01-19 14:14:30 +0000
195++++ new/shell/shell-search-renderer.c 2012-02-06 16:51:44 +0000
196+@@ -212,7 +212,7 @@
197+
198+ shell_search_renderer_set_layout (SHELL_SEARCH_RENDERER (cell), widget);
199+
200+- pango_layout_set_width (priv->layout, PANGO_SCALE * 180);
201++ pango_layout_set_width (priv->layout, PANGO_SCALE * 164);
202+ pango_layout_get_pixel_extents (priv->layout, NULL, &rect);
203+
204+ if (width) *width = rect.width;
205+@@ -278,6 +278,8 @@
206+ ShellSearchRendererPrivate *priv = SHELL_SEARCH_RENDERER (cell)->priv;
207+ PangoRectangle rect;
208+ GtkStyleContext *context;
209++ gint layout_height;
210++ gint vcenter_offset;
211+
212+ context = gtk_widget_get_style_context (widget);
213+
214+@@ -285,11 +287,14 @@
215+
216+ pango_layout_get_pixel_extents (priv->layout, NULL, &rect);
217+
218++ pango_layout_get_pixel_size (priv->layout, NULL, &layout_height);
219++ vcenter_offset = (cell_area->height - layout_height) / 2;
220++
221+ cairo_save (cr);
222+
223+ gtk_render_layout (context, cr,
224+ cell_area->x,
225+- cell_area->y,
226++ cell_area->y + vcenter_offset,
227+ priv->layout);
228+
229+ cairo_restore (cr);
230
231
232=== modified file 'debian/patches/series'
233--- debian/patches/series 2012-01-24 17:15:29 +0000
234+++ debian/patches/series 2012-02-06 17:21:06 +0000
235@@ -17,7 +17,7 @@
236 55_user_accounts_hide_controls.patch
237 56_use_ubuntu_info_branding.patch
238 57_use_nonsymbolic_keyboard_icon.patch
239-58_ubuntu_category_headers_redesign.patch
240+58_ubuntu_icon_views_redesign.patch
241 90_force_fallback.patch
242 91_configure_cheese.patch
243 90_git_sound_tab_order.patch

Subscribers

People subscribed via source and target branches