[Xfce4-commits] xfce4-mailwatch-plugin:master Remove needless function call

2013-12-19 Thread Ján Sučan
Updating branch refs/heads/master
 to 4888631fb62a4dcaa3e666348e5726acd830acce (commit)
   from db591222fa05cb6504bec29a2ca0e55a352bcaa2 (commit)

commit 4888631fb62a4dcaa3e666348e5726acd830acce
Author: Ján Sučan su...@runbox.com
Date:   Thu Dec 19 16:56:52 2013 +0100

Remove needless function call

 libmailwatch-core/mailwatch-mailbox-imap.c |8 
 libmailwatch-core/mailwatch-mailbox-pop3.c |4 ++--
 libmailwatch-core/mailwatch-utils.c|6 --
 libmailwatch-core/mailwatch-utils.h|2 --
 libmailwatch-core/mailwatch.c  |2 +-
 panel-plugin/mailwatch-plugin.c|4 ++--
 6 files changed, 9 insertions(+), 17 deletions(-)

diff --git a/libmailwatch-core/mailwatch-mailbox-imap.c 
b/libmailwatch-core/mailwatch-mailbox-imap.c
index 47b2229..78cc7c1 100644
--- a/libmailwatch-core/mailwatch-mailbox-imap.c
+++ b/libmailwatch-core/mailwatch-mailbox-imap.c
@@ -1415,7 +1415,7 @@ imap_config_newmailfolders_btn_clicked_cb(GtkWidget *w, 
gpointer user_data)
  G_CALLBACK(imap_config_newmailfolders_destroy_cb),
  imailbox);
 
-frame = xfce_mailwatch_create_framebox(_(New Mail Folders), frame_bin);
+frame = xfce_gtk_frame_box_new(_(New Mail Folders), frame_bin);
 gtk_widget_show(frame);
 gtk_box_pack_start(GTK_BOX(topvbox), frame, TRUE, TRUE, 0);
 
@@ -1592,7 +1592,7 @@ imap_config_advanced_btn_clicked_cb(GtkWidget *w, 
gpointer user_data)
 gtk_widget_show(topvbox);
 gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dlg)-vbox), topvbox, TRUE, TRUE, 0);
 
-frame = xfce_mailwatch_create_framebox(_(Connection), frame_bin);
+frame = xfce_gtk_frame_box_new(_(Connection), frame_bin);
 gtk_widget_show(frame);
 gtk_box_pack_start(GTK_BOX(topvbox), frame, FALSE, FALSE, 0);
 
@@ -1649,7 +1649,7 @@ imap_config_advanced_btn_clicked_cb(GtkWidget *w, 
gpointer user_data)
 g_object_set_data(G_OBJECT(chk), xfmw-entry, entry);
 g_object_set_data(G_OBJECT(combo), xfmw-entry, entry);
 
-frame = xfce_mailwatch_create_framebox(_(Folders), frame_bin);
+frame = xfce_gtk_frame_box_new(_(Folders), frame_bin);
 gtk_widget_show(frame);
 gtk_box_pack_start(GTK_BOX(topvbox), frame, FALSE, FALSE, 0);
 
@@ -1687,7 +1687,7 @@ imap_get_setup_page(XfceMailwatchMailbox *mailbox)
 topvbox = gtk_vbox_new(FALSE, BORDER/2);
 gtk_widget_show(topvbox);
 
-frame = xfce_mailwatch_create_framebox(_(IMAP Server), frame_bin);
+frame = xfce_gtk_frame_box_new(_(IMAP Server), frame_bin);
 gtk_widget_show(frame);
 gtk_box_pack_start(GTK_BOX(topvbox), frame, FALSE, FALSE, 0);
 
diff --git a/libmailwatch-core/mailwatch-mailbox-pop3.c 
b/libmailwatch-core/mailwatch-mailbox-pop3.c
index 352eced..291d0cc 100644
--- a/libmailwatch-core/mailwatch-mailbox-pop3.c
+++ b/libmailwatch-core/mailwatch-mailbox-pop3.c
@@ -755,7 +755,7 @@ pop3_config_advanced_btn_clicked_cb(GtkWidget *w, gpointer 
user_data)
 gtk_widget_show(topvbox);
 gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dlg)-vbox), topvbox, TRUE, TRUE, 0);
 
-frame = xfce_mailwatch_create_framebox(_(Connection), frame_bin);
+frame = xfce_gtk_frame_box_new(_(Connection), frame_bin);
 gtk_widget_show(frame);
 gtk_box_pack_start(GTK_BOX(topvbox), frame, FALSE, FALSE, 0);
 
@@ -827,7 +827,7 @@ pop3_get_setup_page(XfceMailwatchMailbox *mailbox)
 topvbox = gtk_vbox_new(FALSE, BORDER/2);
 gtk_widget_show(topvbox);
 
-frame = xfce_mailwatch_create_framebox(_(POP3 Server), frame_bin);
+frame = xfce_gtk_frame_box_new(_(POP3 Server), frame_bin);
 gtk_widget_show(frame);
 gtk_box_pack_start(GTK_BOX(topvbox), frame, FALSE, FALSE, 0);
 
diff --git a/libmailwatch-core/mailwatch-utils.c 
b/libmailwatch-core/mailwatch-utils.c
index 1771b7d..3feeb22 100644
--- a/libmailwatch-core/mailwatch-utils.c
+++ b/libmailwatch-core/mailwatch-utils.c
@@ -105,12 +105,6 @@ xfce_mailwatch_custom_button_new(const gchar *text, const 
gchar *icon)
 return btn;
 }
 
-GtkWidget *
-xfce_mailwatch_create_framebox(const gchar *title, GtkWidget **frame_bin)
-{
-return xfce_gtk_frame_box_new(title, frame_bin);
-}
-
 #ifdef HAVE_SSL_SUPPORT
 /* assumes |dest| is allocated 2x |src_len| */
 static void
diff --git a/libmailwatch-core/mailwatch-utils.h 
b/libmailwatch-core/mailwatch-utils.h
index 0c9a917..da395eb 100644
--- a/libmailwatch-core/mailwatch-utils.h
+++ b/libmailwatch-core/mailwatch-utils.h
@@ -32,8 +32,6 @@ typedef enum
 
 GtkWidget *xfce_mailwatch_custom_button_new(const gchar *text,
 const gchar *icon);
-GtkWidget *xfce_mailwatch_create_framebox(const gchar *title,
-  GtkWidget **frame_bin);
 
 gchar *xfce_mailwatch_cram_md5(const gchar *username,
const gchar *password,
diff --git a/libmailwatch-core/mailwatch.c b/libmailwatch-core/mailwatch.c
index 

[Xfce4-commits] xfdesktop:master Scale down oversize icons in menus (Bugs 10545, 10461)

2013-12-19 Thread Eric Koegel
Updating branch refs/heads/master
 to 596ac7b07939b3b93c6253b2db704a91e68e75d0 (commit)
   from 37baff27944ba6282e420069e0993f08953ff482 (commit)

commit 596ac7b07939b3b93c6253b2db704a91e68e75d0
Author: Eric Koegel eric.koe...@gmail.com
Date:   Sun Dec 15 12:18:01 2013 +0300

Scale down oversize icons in menus (Bugs 10545, 10461)

Use exo_gdk_pixbuf_scale_down to ensure the icons in the menu don't
exceed the selected icon size.

 src/xfdesktop-app-menu-item.c |6 ++
 1 file changed, 6 insertions(+)

diff --git a/src/xfdesktop-app-menu-item.c b/src/xfdesktop-app-menu-item.c
index 8485f4c..ca19499 100644
--- a/src/xfdesktop-app-menu-item.c
+++ b/src/xfdesktop-app-menu-item.c
@@ -31,6 +31,7 @@
 
 #include libxfce4util/libxfce4util.h
 #include libxfce4ui/libxfce4ui.h
+#include exo/exo.h
 
 #include xfdesktop-app-menu-item.h
 
@@ -212,6 +213,11 @@ xfdesktop_app_menu_item_set_icon(XfdesktopAppMenuItem 
*app_menu_item)
 
 /* Turn the pixbuf into a gtk_image */
 if(G_LIKELY(pixbuf)) {
+/* scale the pixbuf down if it needs it */
+GdkPixbuf *tmp = exo_gdk_pixbuf_scale_down(pixbuf, TRUE, w, h);
+g_object_unref(pixbuf);
+pixbuf = tmp;
+
 image = gtk_image_new_from_pixbuf(pixbuf);
 g_object_unref(G_OBJECT(pixbuf));
 }
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-panel:master pager: fixed wnck pager aspect ratio in deskbar mode

2013-12-19 Thread Andrzej
Updating branch refs/heads/master
 to c42ab58051aaf30ade4496de05fc27e4540eb961 (commit)
   from 862db2d44aed25e8a397f5314f9daab374c4e9fa (commit)

commit c42ab58051aaf30ade4496de05fc27e4540eb961
Author: Andrzej ndrwr...@gmail.com
Date:   Fri Dec 20 03:38:39 2013 +

pager: fixed wnck pager aspect ratio in deskbar mode

Previously we were relying on new api added in libwnck-2.31.
Unfortunately, stable version of libwnck was never released and the API
was not added to libwnck-3.

This commit changes the method of setting the aspect ratio.
Aspect ratio is now calculated in the plugin using screen dimensions.

One minor limitation of this method is that we are not accounting
for wnck pager frames, so the aspect ratio may be slightly inaccurate.

 plugins/pager/pager.c |   64 ++---
 1 file changed, 45 insertions(+), 19 deletions(-)

diff --git a/plugins/pager/pager.c b/plugins/pager/pager.c
index 6f0a378..7b716a2 100644
--- a/plugins/pager/pager.c
+++ b/plugins/pager/pager.c
@@ -53,6 +53,8 @@ static void pager_plugin_set_property 
(GObject   *ob
guint  
prop_id,
const GValue  
*value,
GParamSpec
*pspec);
+static void pager_plugin_size_request (GtkWidget 
*widget,
+   GtkRequisition
*requisition);
 static gboolean pager_plugin_scroll_event (GtkWidget 
*widget,
GdkEventScroll
*event);
 static void pager_plugin_screen_changed   (GtkWidget 
*widget,
@@ -86,6 +88,7 @@ struct _PagerPlugin
   guint  scrolling : 1;
   guint  miniature_view : 1;
   gint   rows;
+  gfloat ratio;
 };
 
 enum
@@ -117,6 +120,7 @@ pager_plugin_class_init (PagerPluginClass *klass)
 
   widget_class = GTK_WIDGET_CLASS (klass);
   widget_class-scroll_event = pager_plugin_scroll_event;
+  widget_class-size_request = pager_plugin_size_request;
 
   plugin_class = XFCE_PANEL_PLUGIN_CLASS (klass);
   plugin_class-construct = pager_plugin_construct;
@@ -156,6 +160,7 @@ pager_plugin_init (PagerPlugin *plugin)
   plugin-scrolling = TRUE;
   plugin-miniature_view = TRUE;
   plugin-rows = 1;
+  plugin-ratio = 1.0;
   plugin-pager = NULL;
 }
 
@@ -303,15 +308,8 @@ pager_plugin_screen_layout_changed (PagerPlugin *plugin)
   if (!wnck_pager_set_n_rows (WNCK_PAGER (plugin-pager), plugin-rows))
 g_message (Setting the pager rows returned false. Maybe the setting 
is not applied.);
 
-#ifdef WNCK_CHECK_VERSION
-#if WNCK_CHECK_VERSION (2,31,0)
-  wnck_pager_set_layout_policy (WNCK_PAGER (plugin-pager),
-(mode == 
XFCE_PANEL_PLUGIN_MODE_HORIZONTAL) ?
-WNCK_PAGER_LAYOUT_POLICY_WIDTH_FOR_HEIGHT :
-WNCK_PAGER_LAYOUT_POLICY_HEIGHT_FOR_WIDTH);
-#endif
-#endif
   wnck_pager_set_orientation (WNCK_PAGER (plugin-pager), orientation);
+  plugin-ratio = (gfloat) gdk_screen_width () / (gfloat) 
gdk_screen_height ();
 }
   else
 {
@@ -421,17 +419,7 @@ pager_plugin_mode_changed (XfcePanelPlugin 
*panel_plugin,
 GTK_ORIENTATION_HORIZONTAL : GTK_ORIENTATION_VERTICAL;
 
   if (plugin-miniature_view)
-{
-#ifdef WNCK_CHECK_VERSION
-#if WNCK_CHECK_VERSION (2,31,0)
-  wnck_pager_set_layout_policy (WNCK_PAGER (plugin-pager),
-(mode == 
XFCE_PANEL_PLUGIN_MODE_HORIZONTAL) ?
-WNCK_PAGER_LAYOUT_POLICY_WIDTH_FOR_HEIGHT :
-WNCK_PAGER_LAYOUT_POLICY_HEIGHT_FOR_WIDTH);
-#endif
-#endif
-  wnck_pager_set_orientation (WNCK_PAGER (plugin-pager), orientation);
-}
+wnck_pager_set_orientation (WNCK_PAGER (plugin-pager), orientation);
   else
 pager_buttons_set_orientation (XFCE_PAGER_BUTTONS (plugin-pager), 
orientation);
 }
@@ -560,3 +548,41 @@ pager_plugin_configure_plugin (XfcePanelPlugin 
*panel_plugin)
 
   gtk_widget_show (GTK_WIDGET (dialog));
 }
+
+
+
+static void
+pager_plugin_size_request (GtkWidget  *widget,
+   GtkRequisition *requisition)
+{
+  PagerPlugin *plugin = XFCE_PAGER_PLUGIN (widget);
+  XfcePanelPluginMode  mode;
+  gint n_workspaces, n_cols;
+
+  if (plugin-miniature_view)
+{
+  mode   = xfce_panel_plugin_get_mode (XFCE_PANEL_PLUGIN (plugin));
+  n_workspaces = wnck_screen_get_workspace_count (plugin-wnck_screen);
+  n_cols = MAX (1, (n_workspaces + plugin-rows - 1) / plugin-rows);
+  if (mode == XFCE_PANEL_PLUGIN_MODE_HORIZONTAL)
+{
+  requisition-height =