[Xfce4-commits] <xfce4-sensors-plugin:master> - got resize working both in stand-alone app and panel plugin

Fabian noreply at xfce.org
Sun Mar 28 21:14:03 CEST 2010


Updating branch refs/heads/master
         to 434f4a6fcf425ad209ada153cc41568b6e9ed985 (commit)
       from b47049f4cd3be8b6cf68fa61785408e6fb509810 (commit)

commit 434f4a6fcf425ad209ada153cc41568b6e9ed985
Author: Fabian <timystery at arcor.de>
Date:   Sun Mar 28 19:55:57 2010 +0200

    - got resize working both in stand-alone app and panel plugin

 lib/cpu.c |   18 +++++++++++-------
 po/de.po  |    2 +-
 2 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/lib/cpu.c b/lib/cpu.c
index 227f744..f27bab3 100644
--- a/lib/cpu.c
+++ b/lib/cpu.c
@@ -201,7 +201,7 @@ gtk_cpu_size_request (GtkWidget *widget, GtkRequisition *requisition)
 static void
 gtk_cpu_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
 {
-  int minwh;
+  //int minwh;
   
   TRACE("enter gtk_cpu_size_allocate\n");
   DBG ("width x height = %d x %d\n", allocation->width, allocation->height);
@@ -209,19 +209,23 @@ gtk_cpu_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
   g_return_if_fail(GTK_IS_CPU(widget));
   g_return_if_fail(allocation != NULL);
 
-  minwh = min(allocation->width, allocation->height);
+  //minwh = min(allocation->width, allocation->height);
+  //DBG("minimum is %d\n", minwh);
   
-  allocation->width = minwh;
-  allocation->height = minwh;
-  DBG ("width x height = %d x %d\n", allocation->width, allocation->height);
+  allocation->width = allocation->height;
+  //allocation->height = minwh;
+  //DBG ("width x height = %d x %d\n", allocation->width, allocation->height);
   widget->allocation = *allocation;
+  
+  gtk_widget_set_size_request(widget, allocation->height, allocation->height);
 
   if (GTK_WIDGET_REALIZED(widget)) {
      gdk_window_move_resize(
          widget->window,
          allocation->x, allocation->y,
-         minwh, minwh // determines width and height of the drawn area
+         allocation->height, allocation->height // determines width and height of the drawn area
      );
+     //gtk_window_resize(widget->window, minwh, minwh);
   }
   DBG ("width x height = %d x %d\n", widget->allocation.width, widget->allocation.height);
   TRACE("leave gtk_cpu_size_allocate\n");
@@ -291,7 +295,7 @@ gtk_cpu_paint (GtkWidget *widget)
   gchar *text;
   GdkGC *gc;
   GdkColor *color;
-  GdkGCValues gcvalues;
+  //GdkGCValues gcvalues;
   int i;
   double percent;
   PangoFontDescription *desc ;
diff --git a/po/de.po b/po/de.po
index 31a614d..8ed5266 100644
--- a/po/de.po
+++ b/po/de.po
@@ -277,7 +277,7 @@ msgstr "Max"
 
 #: ../lib/sensors-interface.c:363
 msgid "Temperature scale:"
-msgstr "Temperaturskala"
+msgstr "Temperaturskala:"
 
 #: ../lib/sensors-interface.c:365
 msgid "_Celsius"



More information about the Xfce4-commits mailing list