[Xfce4-commits] <xfce4-time-out-plugin:master> Ditch _xfce_create_framebox() and use xfce_gtk_frame_box_new() instead

Landry Breuil noreply at xfce.org
Sun Dec 30 17:32:01 CET 2012


Updating branch refs/heads/master
         to 8d85aff5c22fff30f7b10cb09cb1ff4bbff3a0ee (commit)
       from f8d8c71f00cbe891b67116d4fa7178e8ebd31645 (commit)

commit 8d85aff5c22fff30f7b10cb09cb1ff4bbff3a0ee
Author: Landry Breuil <landry at xfce.org>
Date:   Sun Dec 30 17:31:17 2012 +0100

    Ditch _xfce_create_framebox() and use xfce_gtk_frame_box_new() instead

 panel-plugin/time-out.c |   36 +++---------------------------------
 1 files changed, 3 insertions(+), 33 deletions(-)

diff --git a/panel-plugin/time-out.c b/panel-plugin/time-out.c
index 2544f01..5c3cf5d 100644
--- a/panel-plugin/time-out.c
+++ b/panel-plugin/time-out.c
@@ -431,36 +431,6 @@ time_out_about (XfcePanelPlugin *plugin)
                          NULL);
 }
 
-GtkWidget *
-_xfce_create_framebox(const gchar *title, GtkWidget **frame_bin)
-{
-  GtkWidget *framebox;
-
-  g_return_val_if_fail(frame_bin, NULL);
-
-  framebox = gtk_frame_new(NULL);
-  gtk_frame_set_shadow_type(GTK_FRAME(framebox), GTK_SHADOW_NONE);
-  gtk_frame_set_label_align(GTK_FRAME(framebox), 0.0, 1.0);
-  gtk_widget_show(framebox);
-
-  if(title) {
-    gchar *tmp = g_strdup_printf("<b>%s</b>", title);
-    GtkWidget *label = gtk_label_new(tmp);
-    gtk_label_set_use_markup(GTK_LABEL(label), TRUE);
-    gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
-    gtk_widget_show(label);
-    gtk_frame_set_label_widget(GTK_FRAME(framebox), label);
-    g_free(tmp);
-  }
-
-  *frame_bin = gtk_alignment_new(0.0, 0.0, 1.0, 1.0);
-  gtk_alignment_set_padding(GTK_ALIGNMENT(*frame_bin), 5, 5, 21, 5);
-  gtk_widget_show(*frame_bin);
-  gtk_container_add(GTK_CONTAINER(framebox), *frame_bin);
-
-  return framebox;
-}
-
 static void
 time_out_configure (XfcePanelPlugin *plugin,
                     TimeOutPlugin   *time_out)
@@ -504,7 +474,7 @@ time_out_configure (XfcePanelPlugin *plugin,
   gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_CENTER);
 
   /* Create time settings section */
-  framebox = _xfce_create_framebox (_("Time settings"), &timebin);
+  framebox = xfce_gtk_frame_box_new (_("Time settings"), &timebin);
   gtk_container_set_border_width (GTK_CONTAINER (framebox), 6);
   gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), framebox, TRUE, TRUE, 0);
   gtk_widget_show (framebox);
@@ -588,7 +558,7 @@ time_out_configure (XfcePanelPlugin *plugin,
   gtk_widget_show (spin);
 
   /* Create behaviour section */
-  framebox = _xfce_create_framebox (_("Behaviour"), &behaviourbin);
+  framebox = xfce_gtk_frame_box_new (_("Behaviour"), &behaviourbin);
   gtk_container_set_border_width (GTK_CONTAINER (framebox), 6);
   gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), framebox, TRUE, TRUE, 0);
   gtk_widget_show (framebox);
@@ -613,7 +583,7 @@ time_out_configure (XfcePanelPlugin *plugin,
   gtk_widget_show (checkbutton);
 
   /* Create appearance section */
-  framebox = _xfce_create_framebox (_("Appearance"), &appearancebin);
+  framebox = xfce_gtk_frame_box_new (_("Appearance"), &appearancebin);
   gtk_container_set_border_width (GTK_CONTAINER (framebox), 6);
   gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), framebox, TRUE, TRUE, 0);
   gtk_widget_show (framebox);


More information about the Xfce4-commits mailing list