Merge lp:~sqp/cairo-dock-core/gui-flexible-behaviour into lp:~cairo-dock-team/cairo-dock-core/cairo-dock

Proposed by SQP
Status: Merged
Merged at revision: 1140
Proposed branch: lp:~sqp/cairo-dock-core/gui-flexible-behaviour
Merge into: lp:~cairo-dock-team/cairo-dock-core/cairo-dock
Diff against target: 1007 lines (+328/-203)
9 files modified
data/cairo-dock-simple.conf.in (+3/-9)
data/cairo-dock.conf.in (+48/-47)
data/themes.conf.in (+2/-8)
po/misc/cairo-dock-extract-message.c (+1/-0)
src/cairo-dock-gui-commons.c (+3/-0)
src/cairo-dock-gui-items.c (+1/-1)
src/cairo-dock-gui-simple.c (+3/-17)
src/gldit/cairo-dock-gui-factory.c (+265/-121)
src/gldit/cairo-dock-gui-factory.h (+2/-0)
To merge this branch: bzr merge lp:~sqp/cairo-dock-core/gui-flexible-behaviour
Reviewer Review Type Date Requested Status
Fabounet Approve
Review via email: mp+97093@code.launchpad.net

Description of the change

To post a comment you must log in.
Revision history for this message
Fabounet (fabounet03) wrote :

great :-)

review: Approve
Revision history for this message
Matthieu Baerts (matttbe) wrote :

Thanks guys for all these new modifications ;)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'data/cairo-dock-simple.conf.in'
2--- data/cairo-dock-simple.conf.in 2012-02-21 00:43:57 +0000
3+++ data/cairo-dock-simple.conf.in 2012-03-12 19:47:19 +0000
4@@ -91,10 +91,7 @@
5 #[gtk-select-font]
6 [Shortkeys]
7
8-#F[Keyboard shortcuts currently available;gtk-select-font]
9-frame_key=
10-
11-#_
12+#<
13 #{Many applets provide shortkeys for their actions. As soon as an applet is enabled, its shortkeys become available.
14 #Double-click on a line, and press the shortkey you want to use for the corresponding action.}
15 shortkeys=
16@@ -103,10 +100,7 @@
17 #[@pkgdatadir@/icons/icon-plug-ins.svg]
18 [Add-ons]
19
20-#F[Add or remove any applet;@pkgdatadir@/icons/icon-accessories.svg]
21-frame_mod=
22-
23-#_
24+#<
25 #{Select a line to get a preview and a description of the applet.
26 #Click on the left check-box to (de)activate an applet.
27 #Once an applet is active, you can configure it by right clicking on its icon.}
28@@ -120,5 +114,5 @@
29 #[@pkgdatadir@/icons/icon-controler.svg]
30 [Themes]
31
32-#_
33+#<
34 notebook=
35
36=== modified file 'data/cairo-dock.conf.in'
37--- data/cairo-dock.conf.in 2012-02-21 00:43:08 +0000
38+++ data/cairo-dock.conf.in 2012-03-12 19:47:19 +0000
39@@ -195,10 +195,7 @@
40 #[gtk-select-font]
41 [Shortkeys]
42
43-#F[Keyboard shortcuts currently available;gtk-select-font]
44-frame_key=
45-
46-#_
47+#<
48 #{Many applets provide shortkeys for their actions. As soon as an applet is enabled, its shortkeys become available.
49 #Double-click on a line, and press the shortkey you want to use for the corresponding action.}
50 shortkeys=
51@@ -206,6 +203,48 @@
52
53 [System]
54
55+#F-[Proxy;gtk-network]
56+frame_proxy =
57+
58+#B-[4] Are you behind a proxy ?
59+#{Use this option if you connect to the Internet through a proxy.}
60+conn use proxy = false
61+
62+#s- Proxy name :
63+conn proxy =
64+
65+#i- Port :
66+conn port = 0
67+
68+#s- User :
69+#{Let empty if you don't need to log-in to the proxy with a user/password.}
70+conn user =
71+
72+#p- Password :
73+#{Let empty if you don't need to log-in to the proxy with a user/password.}
74+conn passwd =
75+
76+#X-[Connection to the Internet;gtk-network]
77+frame_conn =
78+
79+#i-[1;20] Connection timeout :
80+#{Maximum time in seconds that you allow the connection to the server to take. This only limits the connection phase, once the dock has connected this option is of no more use.}
81+conn timeout = 10
82+
83+#i-[10;300] Maximum time to download a file:
84+#{Maximum time in seconds that you allow the whole operation to last. Some themes can be up to a few MB.}
85+conn max time = 120
86+
87+#b- Force IPv4 ?
88+#{Use this option if you experience problems to connect.}
89+force ipv4 = true
90+
91+#X-[Composition;gtk-clear]
92+frame_fake =
93+#b- Emulate composition with fake transparency?
94+#{Only use this if you don't run a composite manager like Compiz, xcompmgr, etc and have a black background around your dock. For aesthetic reasons, the dock will be kept under other windows.}
95+fake transparency = false
96+
97 #X-[Animations speed;@pkgdatadir@/icons/icon-movment.png]
98 frame_mov =
99
100@@ -253,44 +292,6 @@
101 #{The transparency gradation pattern will then be re-calculated in real time. May need more CPU power.}
102 dynamic reflection = false
103
104-#X-[Composition;gtk-clear]
105-frame_fake =
106-#b- Emulate composition with fake transparency?
107-#{Only use this if you don't run a composite manager like Compiz, xcompmgr, etc and have a black background around your dock. For aesthetic reasons, the dock will be kept under other windows.}
108-fake transparency = false
109-
110-#X-[Connection to the Internet;gtk-network]
111-frame_conn =
112-
113-#i-[1;20] Connection timeout :
114-#{Maximum time in seconds that you allow the connection to the server to take. This only limits the connection phase, once the dock has connected this option is of no more use.}
115-conn timeout = 10
116-
117-#i-[10;300] Maximum time to download a file:
118-#{Maximum time in seconds that you allow the whole operation to last. Some themes can be up to a few MB.}
119-conn max time = 120
120-
121-#b- Force IPv4 ?
122-#{Use this option if you experience problems to connect.}
123-force ipv4 = true
124-
125-#B-[4] Are you behind a proxy ?
126-#{Use this option if you connect to the Internet through a proxy.}
127-conn use proxy = false
128-
129-#s- Proxy name :
130-conn proxy =
131-
132-#i- Port :
133-conn port = 0
134-
135-#s- User :
136-#{Let empty if you don't need to log-in to the proxy with a user/password.}
137-conn user =
138-
139-#p- Password :
140-#{Let empty if you don't need to log-in to the proxy with a user/password.}
141-conn passwd =
142
143 modules=
144
145@@ -518,6 +519,10 @@
146 #j+[10;128] Icons' size at rest (width x height) :
147 launcher size = 40;40
148
149+#i+[0;50] Space between icons :
150+#{in pixels.}
151+icon gap = 0
152+
153 #F+[Zoom effect;@pkgdatadir@/icons/icon-wave.png]
154 frame_shape =
155 #f+[1;5] Maximum zoom of the icons :
156@@ -528,11 +533,7 @@
157 #{in pixels. Outside of this space (centered on the mouse), there is no zoom.}
158 sinusoid width = 150
159
160-#i+[0;50] Space between icons :
161-#{in pixels.}
162-icon gap = 0
163-
164-#X+[Separators]
165+#F+[Separators]
166 frame_sep =
167
168 #j+[4;128] Icon size at rest (width x height) :
169
170=== modified file 'data/themes.conf.in'
171--- data/themes.conf.in 2011-09-21 00:00:16 +0000
172+++ data/themes.conf.in 2012-03-12 19:47:19 +0000
173@@ -1,7 +1,7 @@
174 #@VERSION@
175
176 #[gtk-open]
177-[Themes]
178+[Load theme]
179
180 #R[@pkgdatadir@/themes;../@CAIRO_DOCK_THEMES_DIR@;themes2.4] /
181 chosen theme =
182@@ -24,9 +24,6 @@
183 #[gtk-save]
184 [Save]
185
186-#F[Save current theme]
187-frame1=
188-
189 #H[;../@CAIRO_DOCK_THEMES_DIR@] Save as:
190 #{You will then be able to re-open it at any time.}
191 theme name =
192@@ -51,8 +48,5 @@
193 #[gtk-delete]
194 [Delete]
195
196-#F[List of your personal themes]
197-frame1=
198-
199-#_ Delete from the list themes that you don't need anymore :
200+#< Delete from the list themes that you don't need anymore :
201 deleted themes =
202
203=== modified file 'po/misc/cairo-dock-extract-message.c'
204--- po/misc/cairo-dock-extract-message.c 2011-07-02 23:47:36 +0000
205+++ po/misc/cairo-dock-extract-message.c 2012-03-12 19:47:19 +0000
206@@ -232,6 +232,7 @@
207 case CAIRO_DOCK_WIDGET_JUMP_TO_MODULE_IF_EXISTS :
208
209 case CAIRO_DOCK_WIDGET_EMPTY_WIDGET :
210+ case CAIRO_DOCK_WIDGET_EMPTY_FULL :
211 case CAIRO_DOCK_WIDGET_TEXT_LABEL :
212 case CAIRO_DOCK_WIDGET_HANDBOOK :
213 case CAIRO_DOCK_WIDGET_SEPARATOR :
214
215=== modified file 'src/cairo-dock-gui-commons.c'
216--- src/cairo-dock-gui-commons.c 2012-01-22 02:47:26 +0000
217+++ src/cairo-dock-gui-commons.c 2012-03-12 19:47:19 +0000
218@@ -679,15 +679,18 @@
219 // demander
220 rend = gtk_cell_renderer_text_new ();
221 col = gtk_tree_view_column_new_with_attributes (_("Origin"), rend, "text", CD_SHORTKEY_MODEL_NAME, NULL);
222+ gtk_tree_view_column_set_expand (col, TRUE);
223 gtk_tree_view_column_set_sort_column_id (col, CD_SHORTKEY_MODEL_NAME);
224 gtk_tree_view_append_column (GTK_TREE_VIEW (pOneWidget), col);
225 // action description
226 rend = gtk_cell_renderer_text_new ();
227 col = gtk_tree_view_column_new_with_attributes (_("Action"), rend, "text", CD_SHORTKEY_MODEL_DESCRIPTION, NULL);
228+ gtk_tree_view_column_set_expand (col, TRUE);
229 gtk_tree_view_append_column (GTK_TREE_VIEW (pOneWidget), col);
230 // shortkey
231 rend = gtk_cell_renderer_text_new ();
232 col = gtk_tree_view_column_new_with_attributes (_("Shortkey"), rend, "text", CD_SHORTKEY_MODEL_SHORTKEY, NULL);
233+ gtk_tree_view_column_set_expand (col, TRUE);
234 gtk_tree_view_column_set_cell_data_func (col, rend, (GtkTreeCellDataFunc)_cairo_dock_render_shortkey, NULL, NULL);
235 gtk_tree_view_column_set_sort_column_id (col, CD_SHORTKEY_MODEL_SHORTKEY);
236 gtk_tree_view_append_column (GTK_TREE_VIEW (pOneWidget), col);
237
238=== modified file 'src/cairo-dock-gui-items.c'
239--- src/cairo-dock-gui-items.c 2011-12-03 02:10:56 +0000
240+++ src/cairo-dock-gui-items.c 2012-03-12 19:47:19 +0000
241@@ -239,7 +239,7 @@
242 else // main dock, we display a message
243 {
244 pDataGarbage = g_ptr_array_new ();
245- gchar *cDefaultMessage = g_strdup_printf ("<b><span font_desc=\"Sans 14\">%s</span></b>", _("Main dock's parameters are available in the main configuration window."));
246+ gchar *cDefaultMessage = g_strdup_printf ("<b><big>%s</big></b>", _("Main dock's parameters are available in the main configuration window."));
247 s_pCurrentLauncherWidget = cairo_dock_gui_make_preview_box (pLauncherWindow,
248 NULL, // no selection widget
249 FALSE, // vertical packaging
250
251=== modified file 'src/cairo-dock-gui-simple.c'
252--- src/cairo-dock-gui-simple.c 2012-02-27 00:59:35 +0000
253+++ src/cairo-dock-gui-simple.c 2012-03-12 19:47:19 +0000
254@@ -756,15 +756,6 @@
255 pDataGarbage,
256 NULL); // les widgets seront ajoutes a la liste deja existante. Donc lors de l'ecriture, ils seront ecrit aussi, dans les cles definies dans le fichier de conf (donc de nouveaux groupes seront ajoutés).
257
258- // l'onglet du groupe a deja son propre ascenseur.
259- int i, n = gtk_notebook_get_n_pages (GTK_NOTEBOOK (pThemeNotebook));
260- for (i = 0; i < n; i ++)
261- {
262- GtkWidget *pScrolledWindow = gtk_notebook_get_nth_page (GTK_NOTEBOOK (pThemeNotebook), i);
263- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (pScrolledWindow), GTK_POLICY_NEVER, GTK_POLICY_NEVER);
264- }
265-
266- g_object_set (pThemeNotebook, "height-request", MIN (CAIRO_DOCK_SIMPLE_PANEL_HEIGHT, g_desktopGeometry.iXScreenHeight[CAIRO_DOCK_HORIZONTAL] - 100), NULL); // sinon le notebook est tout petit :-/
267 gtk_box_pack_start (GTK_BOX (myWidget->pKeyBox),
268 pThemeNotebook,
269 TRUE,
270@@ -787,17 +778,16 @@
271
272 //\_____________ On l'ajoute a la fenetre.
273 GtkWidget *pScrolledWindow = gtk_scrolled_window_new (NULL, NULL);
274- g_object_set (pScrolledWindow, "height-request", MIN (2*CAIRO_DOCK_PREVIEW_HEIGHT, g_desktopGeometry.iXScreenHeight[CAIRO_DOCK_HORIZONTAL] - 175), NULL);
275 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (pScrolledWindow), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
276 gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (pScrolledWindow), pOneWidget);
277 myWidget->pSubWidgetList = g_slist_append (myWidget->pSubWidgetList, pOneWidget); // on le met dans la liste, non pas pour recuperer sa valeur, mais pour pouvoir y acceder facilement plus tard.
278 gtk_box_pack_start (GTK_BOX (myWidget->pKeyBox), pScrolledWindow, FALSE, FALSE, 0);
279
280 //\______________ On construit le widget de prevue et on le rajoute a la suite.
281- gchar *cDefaultMessage = g_strdup_printf ("<b><span font_desc=\"Sans 14\">%s</span></b>", _("Click on an applet in order to have a preview and a description for it."));
282+ gchar *cDefaultMessage = g_strdup_printf ("<b><big>%s</big></b>", _("Click on an applet in order to have a preview and a description for it."));
283 GPtrArray *pDataGarbage = g_object_get_data (G_OBJECT (pSimpleConfigWindow), "garbage");
284 GtkWidget *pPreviewBox = cairo_dock_gui_make_preview_box (pSimpleConfigWindow, pOneWidget, FALSE, 1, cDefaultMessage, CAIRO_DOCK_SHARE_DATA_DIR"/images/"CAIRO_DOCK_LOGO, pDataGarbage); // vertical packaging.
285- gtk_box_pack_start (GTK_BOX (myWidget->pKeyBox), pPreviewBox, FALSE, FALSE, 0);
286+ gtk_box_pack_start (GTK_BOX (myWidget->pKeyBox), pPreviewBox, TRUE, TRUE, 0);
287 g_free (cDefaultMessage);
288 }
289 static void _make_shortkeys_widget (GtkWidget *pSimpleConfigWindow)
290@@ -810,12 +800,8 @@
291 GtkWidget *pOneWidget = cairo_dock_build_shortkeys_widget ();
292
293 //\_____________ On l'ajoute a la fenetre.
294- GtkWidget *pScrolledWindow = gtk_scrolled_window_new (NULL, NULL);
295- g_object_set (pScrolledWindow, "height-request", MIN (2*CAIRO_DOCK_PREVIEW_HEIGHT, g_desktopGeometry.iXScreenHeight[CAIRO_DOCK_HORIZONTAL] - 175), NULL);
296- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (pScrolledWindow), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
297- gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (pScrolledWindow), pOneWidget);
298+ gtk_box_pack_start (GTK_BOX (myWidget->pKeyBox), pOneWidget, TRUE, TRUE, 0);
299 myWidget->pSubWidgetList = g_slist_append (myWidget->pSubWidgetList, pOneWidget); // on le met dans la liste, non pas pour recuperer sa valeur, mais pour pouvoir y acceder facilement plus tard.
300- gtk_box_pack_start (GTK_BOX (myWidget->pKeyBox), pScrolledWindow, FALSE, FALSE, 0);
301 }
302 static void _make_widgets (GtkWidget *pSimpleConfigWindow, GKeyFile *pKeyFile)
303 {
304
305=== modified file 'src/gldit/cairo-dock-gui-factory.c'
306--- src/gldit/cairo-dock-gui-factory.c 2012-02-26 03:00:49 +0000
307+++ src/gldit/cairo-dock-gui-factory.c 2012-03-12 19:47:19 +0000
308@@ -24,6 +24,7 @@
309 #include <glib/gstdio.h>
310 #include <glib/gi18n.h>
311
312+#include "../config.h"
313 #include "gldi-config.h"
314 #include "cairo-dock-struct.h"
315 #include "cairo-dock-module-factory.h"
316@@ -242,7 +243,7 @@
317 if (cAuthor == NULL)
318 return NULL;
319 gchar *cBy = g_strdup_printf (_("by %s"), cAuthor);
320- gchar *cThemed = g_strdup_printf ("<small><i>%s </i></small>", cBy); // need space after to prevent italic display bug (top right text truncated)
321+ gchar *cThemed = g_strdup_printf ("<small><tt>%s</tt></small>", cBy);
322 g_free (cBy);
323 return cThemed;
324 }
325@@ -304,7 +305,7 @@
326 return FALSE; // propagate event
327 }
328
329-static inline void _set_preview_image (const gchar *cPreviewFilePath, GtkImage *pPreviewImage)
330+static inline void _set_preview_image (const gchar *cPreviewFilePath, GtkImage *pPreviewImage, GtkWidget *pPreviewImageFrame)
331 {
332 int iPreviewWidth, iPreviewHeight;
333 GtkRequisition requisition;
334@@ -334,6 +335,9 @@
335 1,
336 1);
337 }
338+ else if (pPreviewImageFrame) // We have an image, display border.
339+ gtk_frame_set_shadow_type (GTK_FRAME (pPreviewImageFrame), GTK_SHADOW_ETCHED_IN);
340+
341 gtk_image_set_from_pixbuf (pPreviewImage, pPreviewPixbuf);
342 gdk_pixbuf_unref (pPreviewPixbuf);
343 }
344@@ -353,11 +357,15 @@
345 g_object_set_data (G_OBJECT (pDescriptionLabel), "cd-task", NULL);
346 }
347 }
348-static void _on_got_preview_file (const gchar *cPreviewFilePath, GtkWidget *pPreviewImage)
349+
350+static void _on_got_preview_file (const gchar *cPreviewFilePath, gpointer *data)
351 {
352+ GtkImage *pPreviewImage = data[1];
353+ GtkWidget *pImageFrame = data[7];
354+
355 if (cPreviewFilePath != NULL)
356 {
357- _set_preview_image (cPreviewFilePath, GTK_IMAGE (pPreviewImage));
358+ _set_preview_image (cPreviewFilePath, GTK_IMAGE (pPreviewImage), pImageFrame);
359 g_remove (cPreviewFilePath);
360 }
361 CairoDockTask *pTask = g_object_get_data (G_OBJECT (pPreviewImage), "cd-task");
362@@ -367,6 +375,18 @@
363 g_object_set_data (G_OBJECT (pPreviewImage), "cd-task", NULL);
364 }
365 }
366+
367+static void cairo_dock_label_set_label_show (GtkLabel *pLabel, const gchar *cLabel)
368+{
369+ if (cLabel == NULL)
370+ gtk_widget_hide (GTK_WIDGET (pLabel));
371+ else
372+ {
373+ gtk_label_set_label(GTK_LABEL (pLabel), cLabel);
374+ gtk_widget_show (GTK_WIDGET (pLabel));
375+ }
376+}
377+
378 static void _cairo_dock_selection_changed (GtkTreeModel *model, GtkTreeIter iter, gpointer *data)
379 {
380 static gchar *cPrevPath = NULL;
381@@ -393,6 +413,7 @@
382 GtkLabel* pState = data[4];
383 GtkImage* pStateIcon = data[5];
384 GtkLabel* pSize = data[6];
385+ GtkWidget *pImageFrame = data[7];
386
387 gtk_label_set_justify (GTK_LABEL (pDescriptionLabel), GTK_JUSTIFY_FILL);
388 gtk_label_set_line_wrap (pDescriptionLabel, TRUE);
389@@ -416,24 +437,24 @@
390 if (pTitle)
391 {
392 gchar *cTitle = _cairo_dock_gui_get_package_title (cName, NULL);
393- gtk_label_set_label(GTK_LABEL (pTitle), cTitle);
394+ cairo_dock_label_set_label_show (GTK_LABEL (pTitle), cTitle);
395 g_free (cTitle);
396 }
397 if (pAuthor)
398 {
399 gchar *cBy = _cairo_dock_gui_get_package_author (cAuthor);
400- gtk_label_set_label(GTK_LABEL (pAuthor), cBy);
401+ cairo_dock_label_set_label_show (GTK_LABEL (pAuthor), cBy);
402 g_free (cBy);
403 }
404 if (pState)
405 {
406 const gchar *cState = _cairo_dock_gui_get_package_state (iState);
407- gtk_label_set_label(GTK_LABEL (pState), cState);
408+ cairo_dock_label_set_label_show (GTK_LABEL (pState), cState);
409 }
410 if (pSize)
411 {
412 gchar *cSize = _cairo_dock_gui_get_package_size (fSize);
413- gtk_label_set_label (GTK_LABEL (pSize), cSize);
414+ cairo_dock_label_set_label_show (GTK_LABEL (pSize), cSize);
415 g_free (cSize);
416 }
417 if (pStateIcon)
418@@ -478,6 +499,10 @@
419 gtk_label_set_markup (pDescriptionLabel, NULL);
420 }
421
422+ // Hide image frame until we display the image (which can fail).
423+ if (pImageFrame)
424+ gtk_frame_set_shadow_type (GTK_FRAME (pImageFrame), GTK_SHADOW_NONE);
425+
426 // get or fill the preview image.
427 if (cPreviewFilePath != NULL)
428 {
429@@ -494,11 +519,11 @@
430 cd_debug ("fichier preview distant (%s)", cPreviewFilePath);
431 gtk_image_set_from_pixbuf (pPreviewImage, NULL); // set blank image while downloading.
432
433- pTask = cairo_dock_download_file_async (cPreviewFilePath, NULL, (GFunc) _on_got_preview_file, pPreviewImage); // NULL <=> as a temporary file
434+ pTask = cairo_dock_download_file_async (cPreviewFilePath, NULL, (GFunc) _on_got_preview_file, data); // NULL <=> as a temporary file
435 g_object_set_data (G_OBJECT (pPreviewImage), "cd-task", pTask);
436 }
437 else // fichier local ou rien.
438- _set_preview_image (cPreviewFilePath, pPreviewImage);
439+ _set_preview_image (cPreviewFilePath, pPreviewImage, pImageFrame);
440 }
441
442 g_free (cDescriptionFilePath);
443@@ -1562,59 +1587,87 @@
444 }
445
446 #define _allocate_new_buffer\
447- data = g_new0 (gconstpointer, 7); \
448+ data = g_new0 (gconstpointer, 8); \
449 if (pDataGarbage) g_ptr_array_add (pDataGarbage, data);
450
451+
452+GtkWidget *cairo_dock_widget_image_frame_new (GtkWidget *pWidget)
453+{
454+ // ImageFrame : Display the visible border around the image.
455+ GtkWidget *pImageFrame = gtk_frame_new (NULL);
456+ gtk_frame_set_shadow_type (GTK_FRAME (pImageFrame), GTK_SHADOW_ETCHED_IN);
457+
458+ // ImagePadding : Get some space between the visible border and the image.
459+ GtkWidget *pImagePadding = gtk_frame_new (NULL);
460+ gtk_frame_set_shadow_type (GTK_FRAME (pImagePadding), GTK_SHADOW_NONE);
461+ gtk_container_set_border_width (GTK_CONTAINER (pImagePadding), CAIRO_DOCK_GUI_MARGIN);
462+ gtk_container_add (GTK_CONTAINER (pImageFrame), pImagePadding);
463+
464+ // Return with content widget inside.
465+ gtk_container_add (GTK_CONTAINER (pImagePadding), pWidget);
466+ return pImageFrame;
467+}
468+
469 GtkWidget *cairo_dock_gui_make_preview_box (GtkWidget *pMainWindow, GtkWidget *pOneWidget, gboolean bHorizontalPackaging, int iAddInfoBar, const gchar *cInitialDescription, const gchar *cInitialImage, GPtrArray *pDataGarbage)
470 {
471 gconstpointer *data;
472 _allocate_new_buffer;
473
474- // min size
475- int iFrameWidth = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (pMainWindow), "frame-width"));
476-
477 // readme label.
478- GtkWidget *pDescriptionLabel = gtk_label_new (NULL);
479-
480- g_signal_connect (G_OBJECT (pDescriptionLabel), "destroy", G_CALLBACK (on_delete_async_widget), NULL);
481-
482- int iMinSize = (g_desktopGeometry.iXScreenWidth[CAIRO_DOCK_HORIZONTAL] - iFrameWidth) /2.5;
483+ GtkWidget *pDescriptionLabel = gtk_label_new (cInitialDescription);
484 gtk_label_set_use_markup (GTK_LABEL (pDescriptionLabel), TRUE);
485- if (bHorizontalPackaging)
486- {
487- gtk_widget_set_size_request (pDescriptionLabel, MIN (iMinSize * 1.5, CAIRO_DOCK_README_WIDTH_MIN), CAIRO_DOCK_PREVIEW_HEIGHT);
488- }
489- else
490- gtk_widget_set_size_request (pDescriptionLabel, CAIRO_DOCK_README_WIDTH, -1);
491 gtk_label_set_justify (GTK_LABEL (pDescriptionLabel), GTK_JUSTIFY_LEFT);
492 gtk_label_set_line_wrap (GTK_LABEL (pDescriptionLabel), TRUE);
493+ gtk_label_set_selectable (GTK_LABEL (pDescriptionLabel), TRUE);
494+ g_signal_connect (G_OBJECT (pDescriptionLabel), "destroy", G_CALLBACK (on_delete_async_widget), NULL);
495+
496+ // min size
497+ int iFrameWidth = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (pMainWindow), "frame-width"));
498+ int iMinSize = (g_desktopGeometry.iXScreenWidth[CAIRO_DOCK_HORIZONTAL] - iFrameWidth) /2.5;
499+ #if (GTK_MAJOR_VERSION < 3)
500+ int iLabelWidth = bHorizontalPackaging ? MIN (iMinSize * 1.5, CAIRO_DOCK_README_WIDTH_MIN) : CAIRO_DOCK_README_WIDTH;
501+ gtk_widget_set_size_request (pDescriptionLabel, iLabelWidth, -1);
502+ #endif
503
504 // preview image
505 GtkWidget *pPreviewImage = gtk_image_new_from_pixbuf (NULL);
506-
507 g_signal_connect (G_OBJECT (pPreviewImage), "destroy", G_CALLBACK (on_delete_async_widget), NULL);
508
509- gtk_widget_set_size_request (pPreviewImage,
510- bHorizontalPackaging ? MIN (iMinSize, CAIRO_DOCK_PREVIEW_WIDTH) : CAIRO_DOCK_PREVIEW_WIDTH,
511- bHorizontalPackaging ? CAIRO_DOCK_PREVIEW_HEIGHT : -1);
512-
513+ // Test if can be removed
514+ if (bHorizontalPackaging)
515+ gtk_widget_set_size_request (pPreviewImage, MIN (iMinSize, CAIRO_DOCK_PREVIEW_WIDTH), CAIRO_DOCK_PREVIEW_HEIGHT);
516+
517+ // Add a frame around the image.
518+ GtkWidget *pImageFrame = cairo_dock_widget_image_frame_new (pPreviewImage);
519+ // and load it.
520+ if (cInitialImage)
521+ _set_preview_image (cInitialImage, GTK_IMAGE (pPreviewImage), pImageFrame);
522+ else
523+ gtk_frame_set_shadow_type (GTK_FRAME (pImageFrame), GTK_SHADOW_NONE);
524+
525+ GtkWidget *pPreviewBox;
526+ GtkWidget* pDescriptionFrame = NULL;
527+ GtkWidget* pTextVBox = _gtk_vbox_new (CAIRO_DOCK_GUI_MARGIN);
528+
529 // info bar
530- GtkWidget* pDescriptionFrame = NULL;
531 if (iAddInfoBar)
532 {
533 // vertical frame.
534 pDescriptionFrame = gtk_frame_new (NULL);
535 gtk_frame_set_shadow_type(GTK_FRAME(pDescriptionFrame), GTK_SHADOW_OUT);
536- GtkWidget* pFrameVBox = _gtk_vbox_new (CAIRO_DOCK_GUI_MARGIN);
537- gtk_container_add (GTK_CONTAINER(pDescriptionFrame), pFrameVBox);
538+
539+ pPreviewBox = pDescriptionFrame;
540
541 // title
542 GtkWidget* pTitle = gtk_label_new (NULL);
543 gtk_label_set_use_markup (GTK_LABEL (pTitle), TRUE);
544+ gtk_widget_set_name (pTitle, "pTitle");
545
546 // author
547 GtkWidget* pAuthor = gtk_label_new (NULL);
548 gtk_label_set_use_markup (GTK_LABEL (pAuthor), TRUE);
549+ gtk_widget_set_name (pAuthor, "pAuthor");
550+ gtk_widget_hide (pAuthor);
551
552 data[2] = pTitle;
553 data[3] = pAuthor;
554@@ -1623,7 +1676,13 @@
555 GtkWidget* pFirstLine = _gtk_hbox_new (CAIRO_DOCK_GUI_MARGIN);
556 GtkWidget *pSecondLine = NULL;
557
558- gtk_box_pack_start (GTK_BOX (pFirstLine), pTitle, FALSE, FALSE, CAIRO_DOCK_ICON_MARGIN);
559+ if (bHorizontalPackaging)
560+ {
561+ // Use the frame border for the title.
562+ gtk_frame_set_label_widget (GTK_FRAME (pDescriptionFrame), pTitle);
563+ }
564+ else
565+ gtk_box_pack_start (GTK_BOX (pFirstLine), pTitle, FALSE, FALSE, CAIRO_DOCK_ICON_MARGIN);
566
567 if (iAddInfoBar == 1)
568 {
569@@ -1634,9 +1693,11 @@
570 GtkWidget* pState = gtk_label_new (NULL);
571 gtk_label_set_use_markup (GTK_LABEL (pState), TRUE);
572 gtk_box_pack_end (GTK_BOX (pFirstLine), pState, FALSE, FALSE, CAIRO_DOCK_ICON_MARGIN); // state on the right.
573+ gtk_widget_set_name (pState, "pState");
574
575 GtkWidget* pStateIcon = gtk_image_new_from_pixbuf (NULL);
576 gtk_box_pack_end (GTK_BOX (pFirstLine), pStateIcon, FALSE, FALSE, CAIRO_DOCK_ICON_MARGIN); // icon next to state.
577+ gtk_widget_set_name (pStateIcon, "pStateIcon");
578
579 pSecondLine = _gtk_hbox_new (CAIRO_DOCK_GUI_MARGIN);
580
581@@ -1645,21 +1706,31 @@
582 GtkWidget* pSize = gtk_label_new (NULL);
583 gtk_label_set_use_markup (GTK_LABEL (pSize), TRUE);
584 gtk_box_pack_end (GTK_BOX (pSecondLine), pSize, FALSE, FALSE, CAIRO_DOCK_ICON_MARGIN); // size below state.
585+ gtk_widget_set_name (pSize, "pSize");
586
587 data[4] = pState;
588 data[5] = pStateIcon;
589 data[6] = pSize;
590 }
591 // pack everything in the frame vbox.
592- gtk_box_pack_start (GTK_BOX (pFrameVBox), pFirstLine, FALSE, FALSE, CAIRO_DOCK_GUI_MARGIN);
593+ gtk_box_pack_start (GTK_BOX (pTextVBox), pFirstLine, FALSE, FALSE, CAIRO_DOCK_GUI_MARGIN);
594 if (pSecondLine)
595- gtk_box_pack_start (GTK_BOX (pFrameVBox), pSecondLine, FALSE, FALSE, CAIRO_DOCK_GUI_MARGIN);
596- gtk_box_pack_start (GTK_BOX (pFrameVBox), pDescriptionLabel, TRUE, TRUE, 0);
597+ gtk_box_pack_start (GTK_BOX (pTextVBox), pSecondLine, FALSE, FALSE, CAIRO_DOCK_GUI_MARGIN);
598+ GtkWidget* pDescriptionBox = _gtk_hbox_new (CAIRO_DOCK_GUI_MARGIN); // align text data on the left
599+ gtk_box_pack_start (GTK_BOX (pDescriptionBox), pDescriptionLabel, FALSE, FALSE, CAIRO_DOCK_GUI_MARGIN); // Maybe TRUE pour GTK3 & horiz
600+ gtk_box_pack_start (GTK_BOX (pTextVBox), pDescriptionBox, FALSE, FALSE, CAIRO_DOCK_GUI_MARGIN);
601+ }
602+ else
603+ {
604+ pPreviewBox = pTextVBox;
605+ gtk_box_pack_start (GTK_BOX (pPreviewBox), pDescriptionLabel, FALSE, FALSE, CAIRO_DOCK_GUI_MARGIN);
606 }
607
608 // connect to the widget.
609 data[0] = pDescriptionLabel;
610 data[1] = pPreviewImage;
611+ data[7] = pImageFrame;
612+
613 if (GTK_IS_COMBO_BOX (pOneWidget))
614 {
615 g_signal_connect (G_OBJECT (pOneWidget),
616@@ -1675,20 +1746,128 @@
617 data,
618 NULL);
619 }
620-
621- // pack eveything in a box.
622- GtkWidget *pPreviewBox = (bHorizontalPackaging ? _gtk_hbox_new (CAIRO_DOCK_GUI_MARGIN) : _gtk_vbox_new (CAIRO_DOCK_GUI_MARGIN));
623- gtk_box_pack_start (GTK_BOX (pPreviewBox), pDescriptionFrame ? pDescriptionFrame : pDescriptionLabel, FALSE, FALSE, 0);
624- gtk_box_pack_start (GTK_BOX (pPreviewBox), pPreviewImage, FALSE, FALSE, 0);
625-
626- // initial values
627- if (cInitialDescription)
628- gtk_label_set_markup (GTK_LABEL (pDescriptionLabel), cInitialDescription);
629- if (cInitialImage)
630- _set_preview_image (cInitialImage, GTK_IMAGE (pPreviewImage));
631+
632+ // Build boxes fieldset.
633+ if (bHorizontalPackaging)
634+ {
635+ // FrameHBox will set the frame border full size to the right.
636+ GtkWidget *pFrameHBox = _gtk_hbox_new (CAIRO_DOCK_GUI_MARGIN);
637+ gtk_container_add (GTK_CONTAINER(pDescriptionFrame), pFrameHBox);
638+ gtk_box_pack_start (GTK_BOX (pFrameHBox), pTextVBox, TRUE, TRUE, 0);
639+
640+ GtkWidget *pPreviewImageBox = _gtk_vbox_new (CAIRO_DOCK_GUI_MARGIN);
641+
642+ GtkWidget *pPreviewImageSubBox = _gtk_hbox_new (CAIRO_DOCK_GUI_MARGIN);
643+ gtk_box_pack_start (GTK_BOX (pPreviewImageSubBox), pImageFrame, FALSE, FALSE, 2 * CAIRO_DOCK_GUI_MARGIN);
644+ gtk_box_pack_start (GTK_BOX (pPreviewImageBox), pPreviewImageSubBox, FALSE, FALSE, 0);
645+
646+ gtk_box_pack_end (GTK_BOX (pFrameHBox), pPreviewImageBox, FALSE, FALSE, 2 * CAIRO_DOCK_GUI_MARGIN);
647+ }
648+ else
649+ {
650+ // Add TextVBox to the main frame if created. (iAddInfoBar > 0)
651+ gtk_container_add (GTK_CONTAINER(pDescriptionFrame), pTextVBox);
652+
653+ // pPreviewImageBox : center image on x axis.
654+ GtkWidget *pPreviewImageBox = _gtk_vbox_new (CAIRO_DOCK_GUI_MARGIN);
655+ // pPreviewImageBox : prevent image frame from using full width.
656+ GtkWidget *pPreviewImageSubBox = _gtk_hbox_new (CAIRO_DOCK_GUI_MARGIN);
657+ gtk_box_pack_start (GTK_BOX (pPreviewImageSubBox), pImageFrame, TRUE, FALSE, 0);
658+ gtk_box_pack_start (GTK_BOX (pPreviewImageBox), pPreviewImageSubBox, FALSE, FALSE, 0);
659+ gtk_box_pack_start (GTK_BOX (pTextVBox), pPreviewImageBox, FALSE, FALSE, 2 * CAIRO_DOCK_GUI_MARGIN);
660+ }
661+
662 return pPreviewBox;
663 }
664
665+
666+GtkWidget *cairo_dock_widget_handbook_new (CairoDockModule *pModule)
667+{
668+ g_return_val_if_fail (pModule != NULL, NULL);
669+
670+ // Frame with label
671+ GtkWidget *pFrame = gtk_frame_new (NULL);
672+ gtk_container_set_border_width (GTK_CONTAINER (pFrame), CAIRO_DOCK_GUI_MARGIN);
673+ gchar *cLabel = g_strdup_printf ("<big><b>%s </b></big>v%s",
674+ pModule->pVisitCard->cModuleName,
675+ pModule->pVisitCard->cModuleVersion);
676+ GtkWidget *pLabel = gtk_label_new (cLabel);
677+ g_free (cLabel);
678+ gtk_label_set_use_markup (GTK_LABEL (pLabel), TRUE);
679+ gtk_frame_set_label_widget (GTK_FRAME (pFrame), pLabel);
680+
681+ // TopHBox : Will align widgets on top.
682+ GtkWidget *pTopHBox = _gtk_hbox_new (CAIRO_DOCK_GUI_MARGIN);
683+ gtk_container_add (GTK_CONTAINER (pFrame), pTopHBox);
684+
685+ // TextBox : Align text widgets on the left from top to bottom.
686+ GtkWidget *pTextBox = _gtk_vbox_new (0);
687+ gtk_box_pack_start (GTK_BOX (pTopHBox), pTextBox, FALSE, FALSE, 0);
688+
689+ // Author(s) text
690+ gchar *cDescription = g_strdup_printf ("<small><tt>by %s</tt></small>", pModule->pVisitCard->cAuthor);
691+ pLabel = gtk_label_new (cDescription);
692+ g_free (cDescription);
693+ gtk_label_set_use_markup (GTK_LABEL (pLabel), TRUE);
694+ gtk_label_set_line_wrap (GTK_LABEL (pLabel), TRUE);
695+ gtk_label_set_justify (GTK_LABEL (pLabel), GTK_JUSTIFY_LEFT);
696+ GtkWidget *pAlignLeft = _gtk_hbox_new (CAIRO_DOCK_GUI_MARGIN);
697+ gtk_container_set_border_width (GTK_CONTAINER (pAlignLeft), CAIRO_DOCK_GUI_MARGIN);
698+ gtk_box_pack_start (GTK_BOX (pAlignLeft), pLabel, FALSE, FALSE, 0);
699+ gtk_box_pack_start (GTK_BOX (pTextBox), pAlignLeft, FALSE, FALSE, 0);
700+
701+ // Description Text
702+ cDescription = g_strdup_printf ("<span rise='8000'>%s</span>",
703+ dgettext (pModule->pVisitCard->cGettextDomain, pModule->pVisitCard->cDescription));
704+ pLabel = gtk_label_new (cDescription);
705+ g_free (cDescription);
706+ gtk_label_set_use_markup (GTK_LABEL (pLabel), TRUE);
707+ gtk_label_set_selectable (GTK_LABEL (pLabel), TRUE);
708+ gtk_label_set_line_wrap (GTK_LABEL (pLabel), TRUE);
709+ gtk_label_set_justify (GTK_LABEL (pLabel), GTK_JUSTIFY_LEFT);
710+ #if (GTK_MAJOR_VERSION < 3)
711+ g_object_set (pLabel, "width-request", CAIRO_DOCK_README_WIDTH, NULL);
712+ #endif
713+ gtk_box_pack_start (GTK_BOX (pTextBox), pLabel, FALSE, FALSE, 0);
714+
715+ // ModuleImage
716+ int iPreviewWidth, iPreviewHeight;
717+ GdkPixbuf *pPreviewPixbuf = NULL;
718+ int w=200, h=200;
719+ if (gdk_pixbuf_get_file_info (pModule->pVisitCard->cPreviewFilePath, &iPreviewWidth, &iPreviewHeight) != NULL) // The return value is owned by GdkPixbuf and should not be freed.
720+ {
721+ if (iPreviewWidth > w)
722+ {
723+ iPreviewHeight *= 1.*w/iPreviewWidth;
724+ iPreviewWidth = w;
725+ }
726+ if (iPreviewHeight > h)
727+ {
728+ iPreviewWidth *= 1.*h/iPreviewHeight;
729+ iPreviewHeight = h;
730+ }
731+ pPreviewPixbuf = gdk_pixbuf_new_from_file_at_size (pModule->pVisitCard->cPreviewFilePath, iPreviewWidth, iPreviewHeight, NULL);
732+ if (pPreviewPixbuf != NULL)
733+ {
734+ // ImageBox : Align the image on top.
735+ GtkWidget *pImageBox = _gtk_vbox_new (CAIRO_DOCK_GUI_MARGIN);
736+ gtk_box_pack_end (GTK_BOX (pTopHBox), pImageBox, FALSE, FALSE, CAIRO_DOCK_GUI_MARGIN);
737+
738+ // Image Widget.
739+ GtkWidget *pModuleImage = gtk_image_new_from_pixbuf (NULL);
740+ gtk_image_set_from_pixbuf (GTK_IMAGE (pModuleImage), pPreviewPixbuf);
741+ gdk_pixbuf_unref (pPreviewPixbuf);
742+
743+ // Add a frame around the image.
744+ GtkWidget *pImageFrame = cairo_dock_widget_image_frame_new (pModuleImage);
745+ gtk_box_pack_start (GTK_BOX (pImageBox), pImageFrame, FALSE, FALSE, 0);
746+ }
747+ }
748+
749+ return pFrame;
750+}
751+
752+
753 #define _pack_in_widget_box(pSubWidget) gtk_box_pack_start (GTK_BOX (pWidgetBox), pSubWidget, FALSE, FALSE, 0)
754 #define _pack_subwidget(pSubWidget) do {\
755 pSubWidgetList = g_slist_append (pSubWidgetList, pSubWidget);\
756@@ -1725,7 +1904,7 @@
757 }
758 #endif
759
760-#define _add_combo_from_modele(modele, bAddPreviewWidgets, bWithEntry) do {\
761+#define _add_combo_from_modele(modele, bAddPreviewWidgets, bWithEntry, bHorizontalPackaging) do {\
762 if (modele == NULL) { \
763 pOneWidget = _combo_box_entry_new ();\
764 _pack_subwidget (pOneWidget); }\
765@@ -1739,8 +1918,9 @@
766 gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (pOneWidget), rend, FALSE);\
767 gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (pOneWidget), rend, "text", CAIRO_DOCK_MODEL_NAME, NULL);}\
768 if (bAddPreviewWidgets) {\
769- pPreviewBox = cairo_dock_gui_make_preview_box (pMainWindow, pOneWidget, TRUE, 1, NULL, NULL, pDataGarbage);\
770- gtk_box_pack_start (GTK_BOX (pAdditionalItemsVBox ? pAdditionalItemsVBox : pKeyBox), pPreviewBox, FALSE, FALSE, 0);}\
771+ pPreviewBox = cairo_dock_gui_make_preview_box (pMainWindow, pOneWidget, bHorizontalPackaging, 1, NULL, NULL, pDataGarbage);\
772+ gboolean bFullSize = bWithEntry || bHorizontalPackaging;\
773+ gtk_box_pack_start (GTK_BOX (pAdditionalItemsVBox ? pAdditionalItemsVBox : pKeyBox), pPreviewBox, bFullSize, bFullSize, 0);}\
774 if (_cairo_dock_find_iter_from_name (modele, cValue, &iter))\
775 gtk_combo_box_set_active_iter (GTK_COMBO_BOX (pOneWidget), &iter);\
776 _pack_subwidget (pOneWidget);\
777@@ -1907,6 +2087,7 @@
778 GtkWidget *pAdditionalItemsVBox;
779 gboolean bIsAligned;
780 gboolean bInsert;
781+ gboolean bFullSize;
782
783 pGroupBox = NULL;
784 pFrame = NULL;
785@@ -1946,16 +2127,31 @@
786 pLabel = NULL;
787 pWidgetBox = NULL;
788 pAdditionalItemsVBox = NULL;
789- if (iElementType != CAIRO_DOCK_WIDGET_FRAME && iElementType != CAIRO_DOCK_WIDGET_EXPANDER && iElementType != CAIRO_DOCK_WIDGET_SEPARATOR)
790+ bFullSize = (iElementType == CAIRO_DOCK_WIDGET_THEME_SELECTOR
791+ || iElementType == CAIRO_DOCK_WIDGET_THEME_LIST
792+ || iElementType == CAIRO_DOCK_WIDGET_VIEW_LIST
793+ || iElementType == CAIRO_DOCK_WIDGET_EMPTY_FULL);
794+
795+ if (iElementType == CAIRO_DOCK_WIDGET_HANDBOOK)
796+ {
797+ cValue = g_key_file_get_string (pKeyFile, cGroupName, cKeyName, NULL);
798+ CairoDockModule *pModule = cairo_dock_find_module_from_name (cValue);
799+ g_free (cValue);
800+ GtkWidget *pHandbook = cairo_dock_widget_handbook_new (pModule);
801+ if (pHandbook != NULL)
802+ gtk_box_pack_start (GTK_BOX (pGroupBox), pHandbook, TRUE, TRUE, 0);
803+ }
804+ else if (iElementType != CAIRO_DOCK_WIDGET_FRAME && iElementType != CAIRO_DOCK_WIDGET_EXPANDER && iElementType != CAIRO_DOCK_WIDGET_SEPARATOR)
805 {
806 //\______________ On cree la boite de la cle.
807 if (iElementType == CAIRO_DOCK_WIDGET_THEME_LIST || iElementType == CAIRO_DOCK_WIDGET_THEME_LIST_ENTRY || iElementType == CAIRO_DOCK_WIDGET_VIEW_LIST)
808 {
809+ bFullSize = TRUE;
810 pAdditionalItemsVBox = _gtk_vbox_new (0);
811 gtk_box_pack_start (pFrameVBox != NULL ? GTK_BOX (pFrameVBox) : GTK_BOX (pGroupBox),
812 pAdditionalItemsVBox,
813- FALSE,
814- FALSE,
815+ bFullSize,
816+ bFullSize,
817 0);
818 pKeyBox = _gtk_hbox_new (CAIRO_DOCK_GUI_MARGIN);
819 gtk_box_pack_start (GTK_BOX (pAdditionalItemsVBox),
820@@ -1969,8 +2165,8 @@
821 pKeyBox = (bIsAligned ? _gtk_hbox_new (CAIRO_DOCK_GUI_MARGIN) : _gtk_vbox_new (CAIRO_DOCK_GUI_MARGIN));
822 gtk_box_pack_start (pFrameVBox != NULL ? GTK_BOX (pFrameVBox) : GTK_BOX (pGroupBox),
823 pKeyBox,
824- FALSE,
825- FALSE,
826+ bFullSize,
827+ bFullSize,
828 0);
829
830 }
831@@ -2012,28 +2208,7 @@
832 }
833
834 //\______________ On cree le label descriptif et la boite du widget.
835- if (iElementType == CAIRO_DOCK_WIDGET_HANDBOOK)
836- {
837- cValue = g_key_file_get_string (pKeyFile, cGroupName, cKeyName, NULL);
838- CairoDockModule *pModule = cairo_dock_find_module_from_name (cValue);
839- if (pModule != NULL)
840- {
841- gchar *cDescription = g_strdup_printf ("<i>%s (v%s) by %s</i>\n%s",
842- pModule->pVisitCard->cModuleName,
843- pModule->pVisitCard->cModuleVersion,
844- pModule->pVisitCard->cAuthor,
845- dgettext (pModule->pVisitCard->cGettextDomain,
846- pModule->pVisitCard->cDescription));
847- pLabel = gtk_label_new (cDescription);
848- gtk_label_set_use_markup (GTK_LABEL (pLabel), TRUE);
849- g_object_set (pLabel, "width-request", CAIRO_DOCK_README_WIDTH, NULL);
850- gtk_label_set_justify (GTK_LABEL (pLabel), GTK_JUSTIFY_LEFT);
851- gtk_label_set_line_wrap (GTK_LABEL (pLabel), TRUE);
852- g_free (cDescription);
853- }
854- g_free (cValue);
855- }
856- else if (*cUsefulComment != '\0' && strcmp (cUsefulComment, "loading...") != 0)
857+ if (*cUsefulComment != '\0' && strcmp (cUsefulComment, "loading...") != 0)
858 {
859 pLabel = gtk_label_new (NULL);
860 gtk_label_set_use_markup (GTK_LABEL (pLabel), TRUE);
861@@ -2052,11 +2227,12 @@
862
863 if (iElementType != CAIRO_DOCK_WIDGET_EMPTY_WIDGET) // inutile si rien dans dedans.
864 { // cette boite permet d'empiler les widgets a droite, mais en les rangeant de gauche a droite normalement.
865+ bFullSize = (iElementType == CAIRO_DOCK_WIDGET_THEME_SELECTOR || iElementType == CAIRO_DOCK_WIDGET_THEME_LIST_ENTRY || iElementType == CAIRO_DOCK_WIDGET_SHORTKEY_SELECTOR);
866 pWidgetBox = _gtk_hbox_new (CAIRO_DOCK_GUI_MARGIN);
867 gtk_box_pack_end (GTK_BOX (pKeyBox),
868 pWidgetBox,
869- FALSE,
870- FALSE,
871+ bFullSize,
872+ bFullSize,
873 0);
874 }
875 }
876@@ -2282,7 +2458,7 @@
877 case CAIRO_DOCK_WIDGET_VIEW_LIST : // liste des vues.
878 {
879 GtkListStore *pRendererListStore = _cairo_dock_build_renderer_list_for_gui ();
880- _add_combo_from_modele (pRendererListStore, TRUE, FALSE);
881+ _add_combo_from_modele (pRendererListStore, TRUE, FALSE, TRUE);
882 g_object_unref (pRendererListStore);
883 }
884 break ;
885@@ -2293,7 +2469,7 @@
886 modele = _cairo_dock_gui_allocate_new_model ();
887 gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (modele), CAIRO_DOCK_MODEL_NAME, GTK_SORT_ASCENDING);
888
889- _add_combo_from_modele (modele, TRUE, iElementType == CAIRO_DOCK_WIDGET_THEME_LIST_ENTRY);
890+ _add_combo_from_modele (modele, TRUE, iElementType == CAIRO_DOCK_WIDGET_THEME_LIST_ENTRY, iElementType == CAIRO_DOCK_WIDGET_THEME_LIST);
891
892 if (iElementType == CAIRO_DOCK_WIDGET_THEME_LIST) // add the state icon.
893 {
894@@ -2356,7 +2532,7 @@
895 case CAIRO_DOCK_WIDGET_ANIMATION_LIST : // liste des animations.
896 {
897 GtkListStore *pAnimationsListStore = _cairo_dock_build_animations_list_for_gui ();
898- _add_combo_from_modele (pAnimationsListStore, FALSE, FALSE);
899+ _add_combo_from_modele (pAnimationsListStore, FALSE, FALSE, FALSE);
900 g_object_unref (pAnimationsListStore);
901 }
902 break ;
903@@ -2364,7 +2540,7 @@
904 case CAIRO_DOCK_WIDGET_DIALOG_DECORATOR_LIST : // liste des decorateurs de dialogue.
905 {
906 GtkListStore *pDialogDecoratorListStore = _cairo_dock_build_dialog_decorator_list_for_gui ();
907- _add_combo_from_modele (pDialogDecoratorListStore, FALSE, FALSE);
908+ _add_combo_from_modele (pDialogDecoratorListStore, FALSE, FALSE, FALSE);
909 g_object_unref (pDialogDecoratorListStore);
910 }
911 break ;
912@@ -2375,7 +2551,7 @@
913 GtkListStore *pDecorationsListStore = ( iElementType == CAIRO_DOCK_WIDGET_DESKLET_DECORATION_LIST ?
914 _cairo_dock_build_desklet_decorations_list_for_gui () :
915 _cairo_dock_build_desklet_decorations_list_for_applet_gui () );
916- _add_combo_from_modele (pDecorationsListStore, FALSE, FALSE);
917+ _add_combo_from_modele (pDecorationsListStore, FALSE, FALSE, FALSE);
918 g_object_unref (pDecorationsListStore);
919
920 _allocate_new_buffer;
921@@ -2444,7 +2620,7 @@
922
923 GtkListStore *pIconThemeListStore = _cairo_dock_build_icon_theme_list_for_gui (pHashTable);
924
925- _add_combo_from_modele (pIconThemeListStore, FALSE, FALSE);
926+ _add_combo_from_modele (pIconThemeListStore, FALSE, FALSE, FALSE);
927
928 g_object_unref (pIconThemeListStore);
929 g_free (cUserPath);
930@@ -2990,15 +3166,14 @@
931 gtk_scrollable_set_vadjustment (GTK_SCROLLABLE (pOneWidget), GTK_ADJUSTMENT (adj));
932 #endif
933 pScrolledWindow = gtk_scrolled_window_new (NULL, NULL);
934- g_object_set (pScrolledWindow, "height-request", CAIRO_DOCK_PREVIEW_HEIGHT+60, NULL); // prevue + readme.
935 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (pScrolledWindow), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
936 gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (pScrolledWindow), pOneWidget);
937 pSubWidgetList = g_slist_append (pSubWidgetList, pOneWidget);
938 _pack_in_widget_box (pScrolledWindow);
939
940 //\______________ On construit le widget de prevue et on le rajoute a la suite.
941- pPreviewBox = cairo_dock_gui_make_preview_box (pMainWindow, pOneWidget, FALSE, 2, NULL, NULL, pDataGarbage); // vertical packaging.
942- _pack_in_widget_box (pPreviewBox);
943+ pPreviewBox = cairo_dock_gui_make_preview_box (pMainWindow, pOneWidget, FALSE, 2, NULL, CAIRO_DOCK_SHARE_DATA_DIR"/images/"CAIRO_DOCK_LOGO, pDataGarbage); // vertical packaging.
944+ gtk_box_pack_start (GTK_BOX (pWidgetBox), pPreviewBox, TRUE, TRUE, 0);
945
946 //\______________ On recupere les themes.
947 if (pAuthorizedValuesList != NULL)
948@@ -3158,6 +3333,7 @@
949 break;
950
951 case CAIRO_DOCK_WIDGET_EMPTY_WIDGET : // container pour widget personnalise.
952+ case CAIRO_DOCK_WIDGET_EMPTY_FULL :
953
954 break ;
955
956@@ -3170,38 +3346,6 @@
957 }
958 break ;
959
960- case CAIRO_DOCK_WIDGET_HANDBOOK : // le label contenant le manuel de l'applet, il a ete place avant.
961- cValue = g_key_file_get_string (pKeyFile, cGroupName, cKeyName, NULL);
962- CairoDockModule *pModule = cairo_dock_find_module_from_name (cValue);
963- if (pModule == NULL)
964- break;
965-
966- int iPreviewWidth, iPreviewHeight;
967- GdkPixbuf *pPreviewPixbuf = NULL;
968- int w=200, h=200;
969- if (gdk_pixbuf_get_file_info (pModule->pVisitCard->cPreviewFilePath, &iPreviewWidth, &iPreviewHeight) != NULL) // The return value is owned by GdkPixbuf and should not be freed.
970- {
971- if (iPreviewWidth > w)
972- {
973- iPreviewHeight *= 1.*w/iPreviewWidth;
974- iPreviewWidth = w;
975- }
976- if (iPreviewHeight > h)
977- {
978- iPreviewWidth *= 1.*h/iPreviewHeight;
979- iPreviewHeight = h;
980- }
981- pPreviewPixbuf = gdk_pixbuf_new_from_file_at_size (pModule->pVisitCard->cPreviewFilePath, iPreviewWidth, iPreviewHeight, NULL);
982- }
983- if (pPreviewPixbuf != NULL)
984- {
985- pPreviewImage = gtk_image_new_from_pixbuf (NULL);
986- gtk_image_set_from_pixbuf (GTK_IMAGE (pPreviewImage), pPreviewPixbuf);
987- gdk_pixbuf_unref (pPreviewPixbuf);
988- _pack_in_widget_box (pPreviewImage);
989- }
990- break ;
991-
992 case CAIRO_DOCK_WIDGET_FRAME : // frame.
993 case CAIRO_DOCK_WIDGET_EXPANDER : // frame dans un expander.
994 if (pAuthorizedValuesList == NULL)
995
996=== modified file 'src/gldit/cairo-dock-gui-factory.h'
997--- src/gldit/cairo-dock-gui-factory.h 2012-02-21 00:43:57 +0000
998+++ src/gldit/cairo-dock-gui-factory.h 2012-03-12 19:47:19 +0000
999@@ -142,6 +142,8 @@
1000
1001 /// an empty GtkContainer, in case you need to build custom widgets.
1002 CAIRO_DOCK_WIDGET_EMPTY_WIDGET='_',
1003+ /// an empty GtkContainer, the same but using full available space.
1004+ CAIRO_DOCK_WIDGET_EMPTY_FULL='<',
1005 /// a simple text label.
1006 CAIRO_DOCK_WIDGET_TEXT_LABEL='>',
1007 /// a simple text label.

Subscribers

People subscribed via source and target branches