Updating branch refs/heads/master
         to cf97fb2aaf5fa71c1323d01cf998766ffeca6ea6 (commit)
       from 761adcb3e6a11eea78f1443ea7d8624310b6645f (commit)

commit cf97fb2aaf5fa71c1323d01cf998766ffeca6ea6
Author: Landry Breuil <lan...@xfce.org>
Date:   Sun Apr 15 22:29:15 2012 +0200

    Port to libxfce4ui
    
    rip xfce_create_framebox() from libxfcegui4/xfce-widget-helpers.c
    and use it in time_out_configure().

 configure.ac.in                     |    6 ++--
 panel-plugin/Makefile.am            |    4 +-
 panel-plugin/time-out-countdown.c   |    2 +-
 panel-plugin/time-out-lock-screen.c |    8 +-----
 panel-plugin/time-out.c             |   39 ++++++++++++++++++++++++++++++----
 5 files changed, 42 insertions(+), 17 deletions(-)

diff --git a/configure.ac.in b/configure.ac.in
index 9600f75..f03ab9b 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -67,9 +67,9 @@ dnl ***********************************
 dnl *** Check for required packages ***
 dnl ***********************************
 XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [2.8.0])
-XDT_CHECK_PACKAGE([LIBXFCEGUI4], [libxfcegui4-1.0], [4.3.99.2])
-XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.3.99.2])
-XDT_CHECK_PACKAGE([LIBXFCE4PANEL], [libxfce4panel-1.0], [4.3.99.2])
+XDT_CHECK_PACKAGE([LIBXFCE4UI], [libxfce4ui-1], [4.8.0])
+XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.8.0])
+XDT_CHECK_PACKAGE([LIBXFCE4PANEL], [libxfce4panel-1.0], [4.8.0])
 
 dnl ***********************************
 dnl *** Check for debugging support ***
diff --git a/panel-plugin/Makefile.am b/panel-plugin/Makefile.am
index 2f660fe..43904f8 100644
--- a/panel-plugin/Makefile.am
+++ b/panel-plugin/Makefile.am
@@ -24,13 +24,13 @@ xfce4_time_out_plugin_CFLAGS =                              
                \
        -DG_LOG_DOMAIN=\"xfce4-time-out-plugin\"                        \
        -DPACKAGE_LOCALE_DIR=\"$(localedir)\"                           \
        $(LIBXFCE4UTIL_CFLAGS)                                          \
-       $(LIBXFCEGUI4_CFLAGS)                                           \
+       $(LIBXFCE4UI_CFLAGS)                                            \
        $(LIBXFCE4PANEL_CFLAGS)                                         \
        $(PLATFORM_CFLAGS)
 
 xfce4_time_out_plugin_LDADD =                                          \
        $(LIBXFCE4UTIL_LIBS)                                            \
-       $(LIBXFCEGUI4_LIBS)                                             \
+       $(LIBXFCE4UI_LIBS)                                              \
        $(LIBXFCE4PANEL_LIBS)
 
 #
diff --git a/panel-plugin/time-out-countdown.c 
b/panel-plugin/time-out-countdown.c
index 0e948bf..e73df6a 100644
--- a/panel-plugin/time-out-countdown.c
+++ b/panel-plugin/time-out-countdown.c
@@ -23,7 +23,7 @@
 #include <config.h>
 #endif
 
-#include <libxfcegui4/libxfcegui4.h>
+#include <libxfce4ui/libxfce4ui.h>
 #include "time-out-countdown.h"
 
 
diff --git a/panel-plugin/time-out-lock-screen.c 
b/panel-plugin/time-out-lock-screen.c
index 7f0b6c3..f36f318 100644
--- a/panel-plugin/time-out-lock-screen.c
+++ b/panel-plugin/time-out-lock-screen.c
@@ -23,7 +23,7 @@
 #include <config.h>
 #endif
 
-#include <libxfcegui4/libxfcegui4.h>
+#include <libxfce4ui/libxfce4ui.h>
 
 #include "time-out-lock-screen.h"
 #include "time-out-countdown.h"
@@ -256,7 +256,6 @@ void
 time_out_lock_screen_show (TimeOutLockScreen *lock_screen, gint max_sec)
 {
   GdkScreen *screen;
-  gint       monitor;
 
   g_return_if_fail (IS_TIME_OUT_LOCK_SCREEN (lock_screen));
 
@@ -271,11 +270,8 @@ time_out_lock_screen_show (TimeOutLockScreen *lock_screen, 
gint max_sec)
   /* Push out changes */
   gdk_flush ();
 
-  /* Determine screen on which the pointer currently is */
-  screen = xfce_gdk_display_locate_monitor_with_pointer (NULL, &monitor);
-
   /* Center window on target monitor */
-  xfce_gtk_window_center_on_monitor (GTK_WINDOW (lock_screen->window), screen, 
monitor);
+  xfce_gtk_window_center_on_active_screen (GTK_WINDOW (lock_screen->window));
 
   lock_screen->max_seconds = max_sec;
 
diff --git a/panel-plugin/time-out.c b/panel-plugin/time-out.c
index 2cb5df7..a881bbc 100644
--- a/panel-plugin/time-out.c
+++ b/panel-plugin/time-out.c
@@ -25,9 +25,8 @@
 
 #include <gtk/gtk.h>
 #include <libxfce4util/libxfce4util.h>
-#include <libxfcegui4/libxfcegui4.h>
+#include <libxfce4ui/libxfce4ui.h>
 #include <libxfce4panel/xfce-panel-plugin.h>
-#include <libxfce4panel/xfce-hvbox.h>
 
 #include "time-out.h"
 #include "time-out-countdown.h"
@@ -434,6 +433,36 @@ 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)
@@ -477,7 +506,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_create_framebox (_("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);
@@ -561,7 +590,7 @@ time_out_configure (XfcePanelPlugin *plugin,
   gtk_widget_show (spin);
 
   /* Create behaviour section */
-  framebox = xfce_create_framebox (_("Behaviour"), &behaviourbin);
+  framebox = _xfce_create_framebox (_("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);
@@ -586,7 +615,7 @@ time_out_configure (XfcePanelPlugin *plugin,
   gtk_widget_show (checkbutton);
 
   /* Create appearance section */
-  framebox = xfce_create_framebox (_("Appearance"), &appearancebin);
+  framebox = _xfce_create_framebox (_("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);
_______________________________________________
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits

Reply via email to