Skip to content

Commit

Permalink
fix show window thumbnails check button
Browse files Browse the repository at this point in the history
adapt ui file to reverted window-list.c
  • Loading branch information
mbkma authored and vkareh committed Sep 2, 2021
1 parent d7f71ea commit 0a5006e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
18 changes: 11 additions & 7 deletions applets/wncklet/window-list.c
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,11 @@ static void tasklist_update_thumbnail_size_spin(TasklistData* tasklist)
gtk_spin_button_set_value(GTK_SPIN_BUTTON(button), (gdouble)tasklist->thumbnail_size);
}

static void show_thumbnails_changed(GSettings* settings, gchar* key, TasklistData* tasklist)
{
tasklist->show_window_thumbnails = g_settings_get_boolean (settings, key);
}

static void thumbnail_size_changed(GSettings *settings, gchar* key, TasklistData* tasklist)
{
tasklist->thumbnail_size = g_settings_get_int(settings, key);
Expand Down Expand Up @@ -629,6 +634,11 @@ static void setup_gsettings(TasklistData* tasklist)
#ifdef HAVE_WINDOW_PREVIEWS
tasklist->preview_settings = mate_panel_applet_settings_new (MATE_PANEL_APPLET (tasklist->applet), WINDOW_LIST_PREVIEW_SCHEMA);

g_signal_connect (tasklist->preview_settings,
"changed::show-window-thumbnails",
G_CALLBACK (show_thumbnails_changed),
tasklist);

g_signal_connect (tasklist->preview_settings,
"changed::thumbnail-window-size",
G_CALLBACK (thumbnail_size_changed),
Expand Down Expand Up @@ -1015,9 +1025,7 @@ static void setup_dialog_wayland(TasklistData* tasklist)
static void setup_dialog(GtkBuilder* builder, TasklistData* tasklist)
{
GtkWidget* button;
#ifdef HAVE_WINDOW_PREVIEWS
GtkAdjustment *adjustment;
#endif /* HAVE_WINDOW_PREVIEWS */


tasklist->wayland_info_label = WID("wayland_info_label");
tasklist->show_current_radio = WID("show_current_radio");
Expand Down Expand Up @@ -1048,10 +1056,6 @@ static void setup_dialog(GtkBuilder* builder, TasklistData* tasklist)
g_object_bind_property(tasklist->show_thumbnails_check, "active", tasklist->thumbnail_size_label, "sensitive", G_BINDING_DEFAULT);
g_object_bind_property(tasklist->show_thumbnails_check, "active", tasklist->thumbnail_size_spin, "sensitive", G_BINDING_DEFAULT);

adjustment = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON(tasklist->thumbnail_size_spin));
gtk_adjustment_set_lower (adjustment, 0);
gtk_adjustment_set_upper (adjustment, 999);
gtk_adjustment_set_step_increment (adjustment, 1);
#else
gtk_widget_hide(WID("window_thumbnail_box"));
#endif
Expand Down
11 changes: 3 additions & 8 deletions applets/wncklet/window-list.ui
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
<property name="resizable">False</property>
<property name="icon-name">mate-panel-window-list</property>
<property name="type-hint">normal</property>
<signal name="response" handler="on_tasklist_properties_dialog_response" swapped="no"/>
<child internal-child="vbox">
<object class="GtkBox">
<property name="can-focus">False</property>
Expand Down Expand Up @@ -159,7 +158,6 @@
<property name="adjustment">adjustment1</property>
<property name="climb-rate">1</property>
<property name="numeric">True</property>
<signal name="value-changed" handler="on_thumbnail_size_spin_value_changed" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
Expand Down Expand Up @@ -226,7 +224,6 @@
<property name="use-underline">True</property>
<property name="active">True</property>
<property name="draw-indicator">True</property>
<signal name="toggled" handler="on_never_group_radio_toggled" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
Expand All @@ -243,7 +240,6 @@
<property name="use-underline">True</property>
<property name="draw-indicator">True</property>
<property name="group">never_group_radio</property>
<signal name="toggled" handler="on_auto_group_radio_toggled" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
Expand All @@ -260,7 +256,6 @@
<property name="use-underline">True</property>
<property name="draw-indicator">True</property>
<property name="group">never_group_radio</property>
<signal name="toggled" handler="on_always_group_radio_toggled" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
Expand Down Expand Up @@ -405,7 +400,7 @@
</packing>
</child>
<child>
<object class="GtkRadioButton" id="display_all_workspaces_radio">
<object class="GtkRadioButton" id="show_all_radio">
<property name="label" translatable="yes">Show windows from a_ll workspaces</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
Expand Down Expand Up @@ -464,7 +459,7 @@
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<object class="GtkRadioButton" id="restore_to_current_workspace_radio">
<object class="GtkRadioButton" id="move_minimized_radio">
<property name="label" translatable="yes">Restore to current _workspace</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
Expand All @@ -487,7 +482,7 @@
<property name="receives-default">False</property>
<property name="use-underline">True</property>
<property name="draw-indicator">True</property>
<property name="group">restore_to_current_workspace_radio</property>
<property name="group">move_minimized_radio</property>
</object>
<packing>
<property name="expand">False</property>
Expand Down

0 comments on commit 0a5006e

Please sign in to comment.