* 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
#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) {
-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());
class SettingsDialog {
public:
class SettingsDialog {
public:
- SettingsDialog(GtkWindow *, int, LauncherItems&);
+ SettingsDialog(GtkWindow *parent, LauncherItems& items);
~SettingsDialog();
gint run();
~SettingsDialog();
gint run();
#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"
bool myTransparent;
// bool myShowInfobanner; // FIXME: to implement
bool myTransparent;
// bool myShowInfobanner; // FIXME: to implement
static char *ourDirs[];
};
static char *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) {
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);
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);
- 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);
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: