* added myIconSize variable for SimpleLauncherApplet (will be configurable in future)
authormishas <mikhail.sobolev@gmail.com>
Tue, 10 Apr 2007 14:38:03 +0000 (14:38 +0000)
committermishas <mikhail.sobolev@gmail.com>
Tue, 10 Apr 2007 14:38:03 +0000 (14:38 +0000)
 * made the icon size for SettingsDialog different from SimpleLauncherApplet uses
 * hardcoded the size for icons used in SettingsDialog

git-svn-id: file:///svnroot/simple-launcher/trunk@155 3ba93dab-e023-0410-b42a-de7732cf370a

settings-dialog.cc
settings-dialog.h
simple-launcher.cc

index 55a7ab6..3af780e 100644 (file)
@@ -23,6 +23,8 @@
 
 #include "settings-dialog.h"
 
 
 #include "settings-dialog.h"
 
+#define SL_APPLET_SETTINGS_ICON_SIZE  26
+
 // FIXME: UGLY!!!!
 
 inline void addPage(GtkNotebook *notebook, const std::string& name, GtkWidget *widget) {
 // FIXME: UGLY!!!!
 
 inline void addPage(GtkNotebook *notebook, const std::string& name, GtkWidget *widget) {
@@ -55,7 +57,7 @@ inline GtkWidget *createUIPage() {
   return vbox;
 }
 
   return vbox;
 }
 
-SettingsDialog::SettingsDialog(GtkWindow *parent, int size, LauncherItems& items) : myList(size, items) {
+SettingsDialog::SettingsDialog(GtkWindow *parent, LauncherItems& items) : myList(SL_APPLET_SETTINGS_ICON_SIZE, items) {
   myDialog = GTK_DIALOG(gtk_dialog_new_with_buttons("Launcher Settings", parent, (GtkDialogFlags)(GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT), "OK", GTK_RESPONSE_OK, "Cancel", GTK_RESPONSE_CANCEL, NULL));
 
   GtkNotebook *notebook = GTK_NOTEBOOK(gtk_notebook_new());
   myDialog = GTK_DIALOG(gtk_dialog_new_with_buttons("Launcher Settings", parent, (GtkDialogFlags)(GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT), "OK", GTK_RESPONSE_OK, "Cancel", GTK_RESPONSE_CANCEL, NULL));
 
   GtkNotebook *notebook = GTK_NOTEBOOK(gtk_notebook_new());
index 4de69ef..268c1f0 100644 (file)
@@ -25,7 +25,7 @@
 
 class SettingsDialog {
 public:
 
 class SettingsDialog {
 public:
-  SettingsDialog(GtkWindow *, int, LauncherItems&);
+  SettingsDialog(GtkWindow *parent, LauncherItems& items);
  ~SettingsDialog();
 
   gint run();
  ~SettingsDialog();
 
   gint run();
index 2211736..5f36aae 100644 (file)
@@ -33,7 +33,6 @@
 
 #define SL_APPLET_DBUS_NAME  "simple-launcher"
 #define SL_APPLET_VERSION    "0.0"
 
 #define SL_APPLET_DBUS_NAME  "simple-launcher"
 #define SL_APPLET_VERSION    "0.0"
-#define SL_APPLET_ICON_SIZE  48
 
 #define SL_APPLET_GCONF_PATH  "/apps/simple-launcher"
 
 
 #define SL_APPLET_GCONF_PATH  "/apps/simple-launcher"
 
@@ -82,6 +81,7 @@ private:
 
   bool myTransparent;
   // bool myShowInfobanner; // FIXME: to implement
 
   bool myTransparent;
   // bool myShowInfobanner; // FIXME: to implement
+  int myIconSize;
 
   static char *ourDirs[];
 };
 
   static char *ourDirs[];
 };
@@ -133,7 +133,7 @@ char *SimpleLauncherApplet::ourDirs[] = {
 };
 
 // SimpleLauncherApplet::SimpleLauncherApplet() : myMainSettings(myClient.getKey(SL_APPLET_GCONF_PATH)), myContext(NULL), myWidget(NULL), myParent(NULL) {
 };
 
 // SimpleLauncherApplet::SimpleLauncherApplet() : myMainSettings(myClient.getKey(SL_APPLET_GCONF_PATH)), myContext(NULL), myWidget(NULL), myParent(NULL) {
-SimpleLauncherApplet::SimpleLauncherApplet() : myContext(NULL), myWidget(NULL), myParent(NULL), myTransparent(false) {
+SimpleLauncherApplet::SimpleLauncherApplet() : myContext(NULL), myWidget(NULL), myParent(NULL), myTransparent(false), myIconSize(48) {
 }
 
 bool SimpleLauncherApplet::doInit(void *state_data, int *state_size) {
 }
 
 bool SimpleLauncherApplet::doInit(void *state_data, int *state_size) {
@@ -273,7 +273,7 @@ void SimpleLauncherApplet::updateWidget() {
 
       gtk_event_box_set_visible_window(GTK_EVENT_BOX(button), !myTransparent);
 
 
       gtk_event_box_set_visible_window(GTK_EVENT_BOX(button), !myTransparent);
 
-      gtk_container_add(GTK_CONTAINER(button), gtk_image_new_from_pixbuf(item->getIcon(SL_APPLET_ICON_SIZE)));
+      gtk_container_add(GTK_CONTAINER(button), gtk_image_new_from_pixbuf(item->getIcon(myIconSize)));
 
       gtk_object_set_user_data(GTK_OBJECT(button), item);
 
 
       gtk_object_set_user_data(GTK_OBJECT(button), item);
 
@@ -288,9 +288,9 @@ void SimpleLauncherApplet::updateWidget() {
   g_object_unref(G_OBJECT(group));
 
   if (button_no == 0) {
   g_object_unref(G_OBJECT(group));
 
   if (button_no == 0) {
-    gtk_widget_set_size_request(myWidget, SL_APPLET_ICON_SIZE, SL_APPLET_ICON_SIZE);
+    gtk_widget_set_size_request(myWidget, myIconSize, myIconSize);
   } else {
   } else {
-    gtk_widget_set_size_request(myWidget, button_no*SL_APPLET_ICON_SIZE, SL_APPLET_ICON_SIZE);
+    gtk_widget_set_size_request(myWidget, button_no*myIconSize, myIconSize);
   }
 
   gtk_widget_show_all(myWidget);
   }
 
   gtk_widget_show_all(myWidget);
@@ -343,7 +343,7 @@ void SimpleLauncherApplet::runDialog() {
 
   LauncherItems newItems = myItems;
 
 
   LauncherItems newItems = myItems;
 
-  SettingsDialog dialog(myParent, SL_APPLET_ICON_SIZE, newItems);
+  SettingsDialog dialog(myParent, newItems);
 
   switch (dialog.run()) {
     case GTK_RESPONSE_OK:
 
   switch (dialog.run()) {
     case GTK_RESPONSE_OK: