[Xfce4-commits] [panel-plugins/xfce4-hardware-monitor-plugin] 39/96: Resizing code finished for now

noreply at xfce.org noreply at xfce.org
Thu Nov 27 22:20:44 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 50e16dc7f65e31f290cb1d0c604c4688f68f6023
Author: Omega Weapon <OmegaPhil at gmail.com>
Date:   Wed Nov 6 17:14:25 2013 +0000

    Resizing code finished for now
---
 src/applet.cpp      |   22 +++++++++++++++++++---
 src/canvas-view.cpp |   12 ++++++++++++
 2 files changed, 31 insertions(+), 3 deletions(-)

diff --git a/src/applet.cpp b/src/applet.cpp
index e88d555..62d6371 100644
--- a/src/applet.cpp
+++ b/src/applet.cpp
@@ -133,6 +133,18 @@ void save_monitors(Applet *applet)
   }
 }
 
+// Same for this function
+// Not needed as the canvas resizes on the fly
+/*
+gboolean size_changed(XfcePanelPlugin* plugin, gint size, Applet* applet)
+{
+  // Debug code
+  std::cout << "Size changed event detected: " << size << "\n";
+
+  return true;
+}
+* */
+
 
 Applet::Applet(XfcePanelPlugin *plugin)
   : panel_applet(plugin),
@@ -225,8 +237,11 @@ Applet::Applet(XfcePanelPlugin *plugin)
 	g_signal_connect_swapped(panel_applet, "save", G_CALLBACK(save_monitors),
     this);
 
-  // TODO: No current code is responsible for resizing, so leaving this alone for now
-	//g_signal_connect(panel_applet, "size-changed", G_CALLBACK(PanelPlugin::size_changed_slot), this);
+  /* Not needed as the canvas resizes on the fly
+  // Hooking into size changed signal
+	g_signal_connect(panel_applet, "size-changed", G_CALLBACK(size_changed),
+    this);
+  */
 
   // Adding configure and about to the applet's right-click menu
 	xfce_panel_plugin_menu_show_configure(panel_applet);
@@ -409,7 +424,8 @@ unsigned int Applet::get_fg_color()
 
 int Applet::get_size() const
 {
-  // Return the width or height depending on the orientation
+  /* Returns the thickness of the panel (i.e. height in the normal
+   * orientation or width in the vertical orientation) */
   return xfce_panel_plugin_get_size(panel_applet);
 }
 
diff --git a/src/canvas-view.cpp b/src/canvas-view.cpp
index cc92f0f..2f9b960 100644
--- a/src/canvas-view.cpp
+++ b/src/canvas-view.cpp
@@ -21,6 +21,8 @@
 
 #include <config.h>
 
+#include <iostream>
+
 #include <libgnomecanvasmm/pixbuf.h>
 
 #include "canvas-view.hpp"
@@ -95,6 +97,13 @@ void CanvasView::do_unset_background()
 
 int CanvasView::width() const
 {
+  /* Remember that applet->get_size returns the thickness of the panel
+   * (i.e. height in the normal orientation or width in the vertical
+   * orientation) */
+
+  // Debug code
+  //std::cout << "CanvasView::width: " << ((applet->horizontal()) ? size : applet->get_size()) << "\n";
+
   if (applet->horizontal())
     return size;
   else
@@ -103,6 +112,9 @@ int CanvasView::width() const
 
 int CanvasView::height() const
 {
+  // Debug code
+  //std::cout << "CanvasView::height: " << ((applet->horizontal()) ? applet->get_size() : size) << "\n";
+
   if (applet->horizontal())
     return applet->get_size();
   else

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


More information about the Xfce4-commits mailing list