Skip to content
Permalink
Browse files

appearance: fixed indentations

  • Loading branch information...
ericek111 authored and raveit65 committed May 19, 2018
1 parent 31880fa commit 8a96f64f45f3da95413514fad2179d0d9fc8ed11
Showing with 60 additions and 58 deletions.
  1. +60 −58 capplets/appearance/appearance-ui.c
@@ -25,90 +25,92 @@
static void
set_have_icons (AppearanceData *data, gboolean value)
{
static const char *menu_item_names[] = {
"menu_item_1",
"menu_item_2",
"menu_item_3",
"menu_item_4",
"menu_item_5",
"cut",
"copy",
"paste",
NULL
};
static const char *menu_item_names[] = {
"menu_item_1",
"menu_item_2",
"menu_item_3",
"menu_item_4",
"menu_item_5",
"cut",
"copy",
"paste",
NULL
};

const char **name;
const char **name;

for (name = menu_item_names; *name != NULL; name++) {
GtkImageMenuItem *item = GTK_IMAGE_MENU_ITEM (appearance_capplet_get_widget (data, *name));
GtkWidget *image;
for (name = menu_item_names; *name != NULL; name++) {
GtkImageMenuItem *item = GTK_IMAGE_MENU_ITEM (appearance_capplet_get_widget (data, *name));
GtkWidget *image;

if (value) {
image = g_object_get_data (G_OBJECT (item), "image");
if (image) {
gtk_image_menu_item_set_image (item, image);
g_object_unref (image);
}
} else {
image = gtk_image_menu_item_get_image (item);
g_object_set_data (G_OBJECT (item), "image", image);
g_object_ref (image);
gtk_image_menu_item_set_image (item, NULL);
if (value) {
image = g_object_get_data (G_OBJECT (item), "image");
if (image) {
gtk_image_menu_item_set_image (item, image);
g_object_unref (image);
}
}
else
{
image = gtk_image_menu_item_get_image (item);
g_object_set_data (G_OBJECT (item), "image", image);
g_object_ref (image);
gtk_image_menu_item_set_image (item, NULL);
}
}
}
}

static void
menus_have_icons_cb (GSettings *settings,
gchar *key,
AppearanceData *data)
gchar *key,
AppearanceData *data)
{
set_have_icons (data, g_settings_get_boolean (settings, key));
set_have_icons (data, g_settings_get_boolean (settings, key));
}

/** GUI Callbacks **/

static gint
button_press_block_cb (GtkWidget *toolbar,
GdkEvent *event,
gpointer data)
GdkEvent *event,
gpointer data)
{
return TRUE;
return TRUE;
}

/** Public Functions **/

void
ui_init (AppearanceData *data)
{
GtkWidget* widget;
GtkWidget* widget;

/* FIXME maybe just remove that stuff from .ui file */
GtkWidget* container = appearance_capplet_get_widget(data, "vbox24");
/* FIXME maybe just remove that stuff from .ui file */
GtkWidget* container = appearance_capplet_get_widget(data, "vbox24");

// Remove menu accels and toolbar style toggles for new GTK versions
gtk_container_remove((GtkContainer *) container,
appearance_capplet_get_widget(data, "menu_accel_toggle"));
gtk_container_remove((GtkContainer *) container,
appearance_capplet_get_widget(data, "hbox11"));
// Remove menu accels and toolbar style toggles for new GTK versions
gtk_container_remove((GtkContainer *) container,
appearance_capplet_get_widget(data, "menu_accel_toggle"));
gtk_container_remove((GtkContainer *) container,
appearance_capplet_get_widget(data, "hbox11"));

widget = appearance_capplet_get_widget(data, "menu_icons_toggle");
g_settings_bind (data->interface_settings,
MENU_ICONS_KEY,
G_OBJECT (widget),
"active",
G_SETTINGS_BIND_DEFAULT);
g_signal_connect (data->interface_settings, "changed::" MENU_ICONS_KEY,
G_CALLBACK (menus_have_icons_cb), data);
widget = appearance_capplet_get_widget(data, "menu_icons_toggle");
g_settings_bind (data->interface_settings,
MENU_ICONS_KEY,
G_OBJECT (widget),
"active",
G_SETTINGS_BIND_DEFAULT);
g_signal_connect (data->interface_settings, "changed::" MENU_ICONS_KEY,
G_CALLBACK (menus_have_icons_cb), data);

set_have_icons (data,
g_settings_get_boolean (data->interface_settings,
MENU_ICONS_KEY));
set_have_icons (data,
g_settings_get_boolean (data->interface_settings,
MENU_ICONS_KEY));

widget = appearance_capplet_get_widget(data, "button_icons_toggle");
g_settings_bind (data->interface_settings,
BUTTON_ICONS_KEY,
G_OBJECT (widget),
"active",
G_SETTINGS_BIND_DEFAULT);
widget = appearance_capplet_get_widget(data, "button_icons_toggle");
g_settings_bind (data->interface_settings,
BUTTON_ICONS_KEY,
G_OBJECT (widget),
"active",
G_SETTINGS_BIND_DEFAULT);
}

0 comments on commit 8a96f64

Please sign in to comment.
You can’t perform that action at this time.