[Xfce4-commits] [panel-plugins/xfce4-hardware-monitor-plugin] 23/96: Viewer size is now properly set

noreply at xfce.org noreply at xfce.org
Thu Nov 27 22:20:28 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 8ae4c7912eb800e18d580252003dbc959130ea22
Author: Omega Weapon <OmegaPhil at gmail.com>
Date:   Sat Nov 2 21:23:33 2013 +0000

    Viewer size is now properly set
---
 src/applet.cpp             |   21 +++++----------------
 src/applet.hpp             |    1 +
 src/preferences-window.cpp |    9 +++++++++
 3 files changed, 15 insertions(+), 16 deletions(-)

diff --git a/src/applet.cpp b/src/applet.cpp
index db97399..c3f67f2 100644
--- a/src/applet.cpp
+++ b/src/applet.cpp
@@ -244,22 +244,6 @@ Applet::Applet(XfcePanelPlugin *plugin)
   if (settings)
     xfce_rc_close(settings);
 
-  /* TODO: This should be completely irrelevant as the view and background colour is already set above
-  // Start displaying something
-  // Ensure config values aren't null
-  get_entry_with_default( gconf_client, gconf_dir + "/viewer_type",
-    Glib::ustring("curve") );
-  get_entry_with_default( gconf_client, gconf_dir + "/background_color",
-    0x00000000 );
-  get_entry_with_default( gconf_client, gconf_dir + "/use_background_color",
-    false );
-  viewer_type_listener(0, gconf_client->get_entry(gconf_dir + "/viewer_type"));
-  background_color_listener(0, gconf_client->get_entry(gconf_dir
-						       + "/background_color"));
-  use_background_color_listener(0, gconf_client->get_entry(gconf_dir
-							   + "/use_background_color"));
-  */
-
 	/* Connect plugin signals to functions - since I'm not really interested
    * in the plugin but the applet pointer, swapped results in the signal
    * handler getting the applet reference first - the plugin pointer is
@@ -451,6 +435,11 @@ int Applet::get_viewer_size() const
   return viewer_size;
 }
 
+void Applet::set_viewer_size(const int size)
+{
+  viewer_size = size;
+}
+
 const Glib::ustring Applet::get_viewer_font()
 {
   return viewer_font;
diff --git a/src/applet.hpp b/src/applet.hpp
index a5815f9..32e3783 100644
--- a/src/applet.hpp
+++ b/src/applet.hpp
@@ -67,6 +67,7 @@ public:
   int get_background_color() const;
   gboolean get_use_background_color() const;
   int get_viewer_size() const;
+  void set_viewer_size(const int size);
   const Glib::ustring get_viewer_font();
   void set_viewer_font(const Glib::ustring font_name);
 
diff --git a/src/preferences-window.cpp b/src/preferences-window.cpp
index df415eb..b1724c8 100644
--- a/src/preferences-window.cpp
+++ b/src/preferences-window.cpp
@@ -25,6 +25,7 @@
 #include <gtkmm/button.h>
 
 #include <cassert>
+#include <iostream>
 
 #include "preferences-window.hpp"
 #include "choose-monitor-window.hpp"
@@ -321,6 +322,14 @@ void PreferencesWindow::size_listener(unsigned int,
 {
   if (size_scale_to_pixels(int(size_scale->get_value())) != viewer_size)
     size_scale->set_value(pixels_to_size_scale(viewer_size));
+
+  // Actually change the size...
+  applet.set_viewer_size(viewer_size);
+  gtk_widget_set_size_request(GTK_WIDGET(applet.panel_applet),
+    viewer_size, -1);
+
+  // Debug code
+  //std::cout << "Viewer size set to " << viewer_size << "\n";
 }
 
 void PreferencesWindow::font_listener(unsigned int,

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


More information about the Xfce4-commits mailing list