]> icculus.org git repositories - dana/obconf.git/blob - src/margins.c
update the year in the copyright
[dana/obconf.git] / src / margins.c
1 /* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
2
3    margins.c for ObConf, the configuration tool for Openbox
4    Copyright (c) 2003-2007   Dana Jansens
5    Copyright (c) 2003        Tim Riley
6
7    This program is free software; you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation; either version 2 of the License, or
10    (at your option) any later version.
11
12    This program is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16
17    See the COPYING file for a copy of the GNU General Public License.
18 */
19
20 #include "main.h"
21 #include "tree.h"
22
23 static gboolean mapping = FALSE;
24
25 void margins_setup_tab()
26 {
27     GtkWidget *w, *w1, *w2, *w3;
28     GtkSizeGroup *group;
29     gchar *s;
30     gint pos;
31
32     mapping = TRUE;
33
34     w = get_widget("margins_left");
35     gtk_spin_button_set_value(GTK_SPIN_BUTTON(w),
36                               tree_get_int("margins/left", 0));
37
38     w = get_widget("margins_right");
39     gtk_spin_button_set_value(GTK_SPIN_BUTTON(w),
40                               tree_get_int("margins/right", 0));
41
42     w = get_widget("margins_top");
43     gtk_spin_button_set_value(GTK_SPIN_BUTTON(w),
44                               tree_get_int("margins/top", 0));
45
46     w = get_widget("margins_bottom");
47     gtk_spin_button_set_value(GTK_SPIN_BUTTON(w),
48                               tree_get_int("margins/bottom", 0));
49
50     mapping = FALSE;
51 }
52
53 void on_margins_left_value_changed(GtkSpinButton *w, gpointer data)
54 {
55     if (mapping) return;
56
57     tree_set_int("margins/left", gtk_spin_button_get_value_as_int(w));
58 }
59
60 void on_margins_right_value_changed(GtkSpinButton *w, gpointer data)
61 {
62     if (mapping) return;
63
64     tree_set_int("margins/right", gtk_spin_button_get_value_as_int(w));
65 }
66
67 void on_margins_top_value_changed(GtkSpinButton *w, gpointer data)
68 {
69     if (mapping) return;
70
71     tree_set_int("margins/top", gtk_spin_button_get_value_as_int(w));
72 }
73
74 void on_margins_bottom_value_changed(GtkSpinButton *w, gpointer data)
75 {
76     if (mapping) return;
77
78     tree_set_int("margins/bottom", gtk_spin_button_get_value_as_int(w));
79 }
80