From 328a3de1f9a1095a1bea2945ba84cfe3e8daab0c Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Thu, 19 Jul 2007 20:02:31 -0400 Subject: [PATCH] add the margins tab --- Makefile.am | 2 + src/main.c | 2 + src/margins.c | 80 ++++ src/margins.h | 25 ++ src/obconf.glade | 1092 ++++++++++++++++++++++++++++++++++++++++++++++ src/strings.c | 11 + 6 files changed, 1212 insertions(+) create mode 100644 src/margins.c create mode 100644 src/margins.h diff --git a/Makefile.am b/Makefile.am index 0326457..b8f1522 100644 --- a/Makefile.am +++ b/Makefile.am @@ -43,6 +43,8 @@ src_obconf_SOURCES = \ src/archive.h \ src/windows.c \ src/windows.h \ + src/margins.c \ + src/margins.h \ src/mouse.c \ src/mouse.h \ src/desktops.c \ diff --git a/src/main.c b/src/main.c index 67d6d2e..7c08f7b 100644 --- a/src/main.c +++ b/src/main.c @@ -22,6 +22,7 @@ #include "theme.h" #include "appearance.h" #include "windows.h" +#include "margins.h" #include "mouse.h" #include "desktops.h" #include "dock.h" @@ -164,6 +165,7 @@ int main(int argc, char **argv) windows_setup_tab(); mouse_setup_tab(); desktops_setup_tab(); + margins_setup_tab(); dock_setup_tab(); mainwin = get_widget("main_window"); diff --git a/src/margins.c b/src/margins.c new file mode 100644 index 0000000..c7e3429 --- /dev/null +++ b/src/margins.c @@ -0,0 +1,80 @@ +/* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*- + + margins.c for ObConf, the configuration tool for Openbox + Copyright (c) 2003-2007 Dana Jansens + Copyright (c) 2003 Tim Riley + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + See the COPYING file for a copy of the GNU General Public License. +*/ + +#include "main.h" +#include "tree.h" + +static gboolean mapping = FALSE; + +void margins_setup_tab() +{ + GtkWidget *w, *w1, *w2, *w3; + GtkSizeGroup *group; + gchar *s; + gint pos; + + mapping = TRUE; + + w = get_widget("margins_left"); + gtk_spin_button_set_value(GTK_SPIN_BUTTON(w), + tree_get_int("margins/left", 0)); + + w = get_widget("margins_right"); + gtk_spin_button_set_value(GTK_SPIN_BUTTON(w), + tree_get_int("margins/right", 0)); + + w = get_widget("margins_top"); + gtk_spin_button_set_value(GTK_SPIN_BUTTON(w), + tree_get_int("margins/top", 0)); + + w = get_widget("margins_bottom"); + gtk_spin_button_set_value(GTK_SPIN_BUTTON(w), + tree_get_int("margins/bottom", 0)); + + mapping = FALSE; +} + +void on_margins_left_value_changed(GtkSpinButton *w, gpointer data) +{ + if (mapping) return; + + tree_set_int("margins/left", gtk_spin_button_get_value_as_int(w)); +} + +void on_margins_right_value_changed(GtkSpinButton *w, gpointer data) +{ + if (mapping) return; + + tree_set_int("margins/right", gtk_spin_button_get_value_as_int(w)); +} + +void on_margins_top_value_changed(GtkSpinButton *w, gpointer data) +{ + if (mapping) return; + + tree_set_int("margins/top", gtk_spin_button_get_value_as_int(w)); +} + +void on_margins_bottom_value_changed(GtkSpinButton *w, gpointer data) +{ + if (mapping) return; + + tree_set_int("margins/bottom", gtk_spin_button_get_value_as_int(w)); +} + diff --git a/src/margins.h b/src/margins.h new file mode 100644 index 0000000..1c2fdae --- /dev/null +++ b/src/margins.h @@ -0,0 +1,25 @@ +/* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*- + + margins.h for ObConf, the configuration tool for Openbox + Copyright (c) 2003-2007 Dana Jansens + Copyright (c) 2003 Tim Riley + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + See the COPYING file for a copy of the GNU General Public License. +*/ + +#ifndef obconf__margins_h +#define obconf__margins_h + +void margins_setup_tab(); + +#endif diff --git a/src/obconf.glade b/src/obconf.glade index 83a8e38..dcdff4d 100644 --- a/src/obconf.glade +++ b/src/obconf.glade @@ -2762,6 +2762,1098 @@ C - The close button + + + 12 + True + False + 6 + + + + True + <span weight="bold">Desktop Margins</span> + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + False + 0 + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + False + 6 + + + + True + False + 0 + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + True + True + + + + + + True + False + 0 + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + True + True + + + + + + True + False + 0 + + + + True + _Top + True + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + margins_top + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + True + + + + + + True + False + 6 + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + True + True + + + + + + True + True + 1 + 0 + True + GTK_UPDATE_ALWAYS + False + False + 20 0 100 1 10 10 + + + + 0 + False + False + + + + + + True + px + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + True + True + + + + + 0 + False + True + + + + + 0 + False + True + + + + + 0 + True + True + + + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + True + True + + + + + 0 + True + True + + + + + + True + False + 0 + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + True + True + + + + + + True + False + 0 + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + True + True + + + + + + True + _Left + True + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + margins_left + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + True + + + + + + True + False + 6 + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + True + True + + + + + + True + True + 1 + 0 + True + GTK_UPDATE_ALWAYS + False + False + 20 0 100 1 10 10 + + + + 0 + False + False + + + + + + True + px + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + True + True + + + + + 0 + False + True + + + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + True + True + + + + + 0 + False + True + + + + + + True + 0.5 + 0.5 + 0 + 0 + + + 0 + True + True + + + + + + True + False + 0 + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + True + True + + + + + + True + _Right + True + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + margins_right + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + True + + + + + + True + False + 6 + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + True + True + + + + + + True + True + 1 + 0 + True + GTK_UPDATE_ALWAYS + False + False + 20 0 100 1 10 10 + + + + 0 + False + False + + + + + + True + px + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + True + True + + + + + 0 + False + True + + + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + True + True + + + + + 0 + False + True + + + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + True + True + + + + + 0 + True + True + + + + + + True + False + 0 + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + True + True + + + + + + True + False + 0 + + + + True + _Bottom + True + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + margins_bottom + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + True + + + + + + True + False + 6 + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + True + True + + + + + + True + True + 1 + 0 + True + GTK_UPDATE_ALWAYS + False + False + 20 0 100 1 10 10 + + + + 0 + False + False + + + + + + True + px + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + True + True + + + + + 0 + False + True + + + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + True + True + + + + + 0 + False + True + + + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + True + True + + + + + 0 + True + True + + + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + True + True + + + + + 0 + True + True + + + + + 0 + True + True + + + + + False + True + + + + + + True + Margins + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + 12 diff --git a/src/strings.c b/src/strings.c index 7ff2733..2b3bdb4 100644 --- a/src/strings.c +++ b/src/strings.c @@ -80,6 +80,17 @@ gchar *s = N_(" "); gchar *s = N_("_Number of desktops: "); gchar *s = N_("_Desktop names:"); gchar *s = N_("Desktops"); +gchar *s = N_("Desktop Margins"); +gchar *s = N_(" "); +gchar *s = N_("_Top"); +gchar *s = N_("px"); +gchar *s = N_("_Left"); +gchar *s = N_("px"); +gchar *s = N_("_Right"); +gchar *s = N_("px"); +gchar *s = N_("_Bottom"); +gchar *s = N_("px"); +gchar *s = N_("Margins"); gchar *s = N_("Position"); gchar *s = N_(" "); gchar *s = N_("_Position:"); -- 2.39.2