[Xfce4-commits] <xfce4-mpc-plugin:master> Only set frame border width if frame is actually displayed.

Landry Breuil noreply at xfce.org
Sun Feb 12 20:30:09 CET 2012


Updating branch refs/heads/master
         to 67e5ab17b5edb41fe0ac1cee1c8e7c9ac10d608a (commit)
       from efa3bc8d04d5ebe3f8a4beac5d47a41b6bc698a0 (commit)

commit 67e5ab17b5edb41fe0ac1cee1c8e7c9ac10d608a
Author: Landry Breuil <landry at xfce.org>
Date:   Sun Feb 12 17:44:50 2012 +0100

    Only set frame border width if frame is actually displayed.
    
    Update frame border width when changing its shadow type too.

 panel-plugin/xfce4-mpc-plugin.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/panel-plugin/xfce4-mpc-plugin.c b/panel-plugin/xfce4-mpc-plugin.c
index 98fe178..741cb9e 100644
--- a/panel-plugin/xfce4-mpc-plugin.c
+++ b/panel-plugin/xfce4-mpc-plugin.c
@@ -55,7 +55,7 @@ static gboolean
 mpc_set_size (XfcePanelPlugin * plugin, int size, t_mpc * mpc)
 {
    DBG ("size=%d",size);
-   gtk_container_set_border_width (GTK_CONTAINER (mpc->frame), (size > 26 ? 2 : 0));
+   gtk_container_set_border_width (GTK_CONTAINER (mpc->frame), (size > 26 && mpc->show_frame ? 2 : 0));
 
    gtk_widget_set_size_request (GTK_WIDGET (mpc->next), size, size);
    gtk_widget_set_size_request (GTK_WIDGET (mpc->prev), size, size);
@@ -213,12 +213,14 @@ mpc_dialog_response (GtkWidget * dlg, int response, t_mpc_dialog * dialog)
 static void
 mpc_dialog_show_frame_toggled (GtkWidget *w, t_mpc_dialog *dialog)
 {
+   int size;
    t_mpc* mpc = dialog->mpc;
 
    DBG ("!");
-
+   size = xfce_panel_plugin_get_size(mpc->plugin);
    mpc->show_frame = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->checkbox_frame));
    gtk_frame_set_shadow_type (GTK_FRAME (mpc->frame), (mpc->show_frame) ? GTK_SHADOW_IN : GTK_SHADOW_NONE);
+   gtk_container_set_border_width (GTK_CONTAINER (mpc->frame), (size > 26 && mpc->show_frame ? 2 : 0));
 }
 
 static void


More information about the Xfce4-commits mailing list