[Xfce4-commits] [panel-plugins/xfce4-hardware-monitor-plugin] 42/96: Properly deal with orientation in Applet::set_viewer_size

noreply at xfce.org noreply at xfce.org
Thu Nov 27 22:20:47 CET 2014


This is an automated email from the git hooks/post-receive script.

nick pushed a commit to branch master
in repository panel-plugins/xfce4-hardware-monitor-plugin.

commit 28473d1e6c4da9abbb8eda1b1f313ba59bcff49d
Author: Omega Weapon <OmegaPhil at gmail.com>
Date:   Wed Nov 6 20:27:40 2013 +0000

    Properly deal with orientation in Applet::set_viewer_size
---
 src/applet.cpp |   13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/src/applet.cpp b/src/applet.cpp
index 62d6371..7cad597 100644
--- a/src/applet.cpp
+++ b/src/applet.cpp
@@ -475,9 +475,16 @@ void Applet::set_viewer_size(const int size)
   */
 
   // Make sure on every call that the viewer size is being honoured
-  // TODO: This needs to deal with orientations
-  if (req_size.width != size)
-    gtk_widget_set_size_request(GTK_WIDGET(panel_applet), size, -1);
+  if (horizontal())
+  {
+    if (req_size.width != size)
+      gtk_widget_set_size_request(GTK_WIDGET(panel_applet), size, -1);
+  }
+  else
+  {
+    if (req_size.height != size)
+      gtk_widget_set_size_request(GTK_WIDGET(panel_applet), -1, size);
+  }
 
   // Exiting if the size hasn't changed from this program's perspective
   if (viewer_size == size)

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list