-SettingsDialog::SettingsDialog(GtkWindow *parent, LauncherItems& items, GConfBooleanOption& transparent, GConfIntegerOption& icon_size, GConfIntegerOption& canvas_size):
+SettingsDialog::SettingsDialog(GtkWindow *parent, LauncherItems& items, GConfBooleanOption& transparent, GConfIntegerOption& icon_size):
myList(SL_APPLET_SETTINGS_ICON_SIZE, items),
myList(SL_APPLET_SETTINGS_ICON_SIZE, items),
- myTransparent(transparent, "Transparent background:"), myIconSize(icon_size, "Icon Size:"), myCanvasSize(canvas_size, "Canvas Size:") {
+ myTransparent(transparent, "Transparent background:"), myIconSize(icon_size, "Icon Size:") {
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());
void SettingsDialog::updateValues() {
myTransparent.updateValue();
myIconSize.updateValue();
void SettingsDialog::updateValues() {
myTransparent.updateValue();
myIconSize.updateValue();
- myCanvasSize.updateValue();
class SettingsDialog {
public:
class SettingsDialog {
public:
- SettingsDialog(GtkWindow *parent, LauncherItems& items, GConfBooleanOption& transparent, GConfIntegerOption& icon_size, GConfIntegerOption& canvas_size);
+ SettingsDialog(GtkWindow *parent, LauncherItems& items, GConfBooleanOption& transparent, GConfIntegerOption& icon_size);
~SettingsDialog();
gint run();
~SettingsDialog();
gint run();
SettingsDialogBooleanEntry myTransparent;
SettingsDialogIntegerEntry myIconSize;
SettingsDialogBooleanEntry myTransparent;
SettingsDialogIntegerEntry myIconSize;
- SettingsDialogIntegerEntry myCanvasSize;
GConfBooleanOption myTransparent;
// bool myShowInfobanner; // FIXME: to implement
GConfIntegerOption myIconSize;
GConfBooleanOption myTransparent;
// bool myShowInfobanner; // FIXME: to implement
GConfIntegerOption myIconSize;
- GConfIntegerOption myCanvasSize;
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(const GConfKey& base) : myContext(NULL), myWidget(NULL), myParent(NULL), myTransparent(base, "transparent", true), myIconSize(base, "icon_size", 48), myCanvasSize(base, "canvas_size", 1) {
+SimpleLauncherApplet::SimpleLauncherApplet(const GConfKey& base) : myContext(NULL), myWidget(NULL), myParent(NULL), myTransparent(base, "transparent", true), myIconSize(base, "icon_size", 48) {
}
bool SimpleLauncherApplet::doInit(void *state_data, int *state_size) {
}
bool SimpleLauncherApplet::doInit(void *state_data, int *state_size) {
g_signal_connect(button, "button-press-event", G_CALLBACK(_button_pressed), this);
gtk_event_box_set_visible_window(GTK_EVENT_BOX(button), !myTransparent.value());
g_signal_connect(button, "button-press-event", G_CALLBACK(_button_pressed), this);
gtk_event_box_set_visible_window(GTK_EVENT_BOX(button), !myTransparent.value());
- gtk_container_set_border_width(GTK_CONTAINER(button), myCanvasSize.value());
{
GdkPixbuf *pixbuf = item->getIcon(myIconSize.value());
{
GdkPixbuf *pixbuf = item->getIcon(myIconSize.value());
g_object_unref(G_OBJECT(group));
g_object_unref(G_OBJECT(group));
- int totalSize = myIconSize.value()+2*myCanvasSize.value();
+ int totalSize = myIconSize.value();
if (button_no == 0) {
gtk_widget_set_size_request(myWidget, totalSize, totalSize);
if (button_no == 0) {
gtk_widget_set_size_request(myWidget, totalSize, totalSize);
LauncherItems newItems = myItems;
// TODO: make it nicer... this code is ugly :(
LauncherItems newItems = myItems;
// TODO: make it nicer... this code is ugly :(
- SettingsDialog dialog(myParent, newItems, myTransparent, myIconSize, myCanvasSize);
+ SettingsDialog dialog(myParent, newItems, myTransparent, myIconSize);
switch (dialog.run()) {
case GTK_RESPONSE_OK:
switch (dialog.run()) {
case GTK_RESPONSE_OK: