Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions data/io.github.kolunmi.Bazaar.gschema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,6 @@
<summary>Global Progress Bar Theme</summary>
<description>Describes the look of the global progress bar</description>
</key>
<key name="rotate-flag" type="b">
<default>false</default>
<summary>Rotate selected flag by 90 degrees</summary>
</key>
<key name="window-dimensions" type="(ii)">
<default>(1220, 900)</default>
<summary>Saved Window Dimensions</summary>
Expand Down
11 changes: 2 additions & 9 deletions src/bz-install-controls.c
Original file line number Diff line number Diff line change
Expand Up @@ -454,11 +454,6 @@ bz_install_controls_set_property (GObject *object,
"changed::global-progress-bar-theme",
G_CALLBACK (pride_flag_changed),
self);
g_signal_connect_swapped (
self->settings,
"changed::rotate-flag",
G_CALLBACK (pride_flag_changed),
self);
}
ensure_draw_css (self);
}
Expand Down Expand Up @@ -679,12 +674,10 @@ ensure_draw_css (BzInstallControls *self)
g_autofree char *id = NULL;
g_autofree char *final_id = NULL;
g_autofree char *class = NULL;
gboolean rotate = FALSE;

id = g_settings_get_string (self->settings, "global-progress-bar-theme");
rotate = g_settings_get_boolean (self->settings, "rotate-flag");
id = g_settings_get_string (self->settings, "global-progress-bar-theme");

if (rotate && g_strcmp0 (id, "accent-color") != 0)
if (g_strcmp0 (id, "accent-color") != 0)
final_id = g_strdup_printf ("%s-horizontal", id);
else
final_id = g_strdup (id);
Expand Down
7 changes: 1 addition & 6 deletions src/bz-preferences-dialog.blp
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,11 @@ template $BzPreferencesDialog: Adw.PreferencesDialog {
row-spacing: 4;
halign: center;
homogeneous: true;
max-children-per-line: 12;
max-children-per-line: 11;
selection-mode: none;
}
};
}
Adw.SwitchRow rotate_switch {
title: _("Vertical Stripes");
subtitle: _("Display flag colors from left to right");
notify::active => $on_rotate_switch_changed();
}
}
}
}
31 changes: 0 additions & 31 deletions src/bz-preferences-dialog.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ struct _BzPreferencesDialog
AdwSwitchRow *search_debounce_switch;
GtkFlowBox *flag_buttons_box;
AdwSwitchRow *hide_eol_switch;
AdwSwitchRow *rotate_switch;

GtkToggleButton *flag_buttons[G_N_ELEMENTS (bar_themes)];
};
Expand Down Expand Up @@ -133,22 +132,6 @@ global_progress_theme_settings_changed (BzPreferencesDialog *self,
}
}

static void
on_rotate_switch_changed (AdwSwitchRow *row,
GParamSpec *pspec,
BzPreferencesDialog *self)
{
gboolean active = FALSE;
active = adw_switch_row_get_active (row);
for (guint i = 0; i < G_N_ELEMENTS (bar_themes); i++)
{
if (active)
gtk_widget_add_css_class (GTK_WIDGET (self->flag_buttons[i]), "horizontal");
else
gtk_widget_remove_css_class (GTK_WIDGET (self->flag_buttons[i]), "horizontal");
}
}

static void
create_flag_buttons (BzPreferencesDialog *self)
{
Expand Down Expand Up @@ -213,18 +196,6 @@ bind_settings (BzPreferencesDialog *self)
self->hide_eol_switch, "active",
G_SETTINGS_BIND_DEFAULT);

g_settings_bind (self->settings, "rotate-flag",
self->rotate_switch, "active",
G_SETTINGS_BIND_DEFAULT);

if (adw_switch_row_get_active (self->rotate_switch))
{
for (guint i = 0; i < G_N_ELEMENTS (bar_themes); i++)
{
gtk_widget_add_css_class (GTK_WIDGET (self->flag_buttons[i]), "horizontal");
}
}

g_signal_connect_object (
self->settings,
"changed::global-progress-bar-theme",
Expand Down Expand Up @@ -299,9 +270,7 @@ bz_preferences_dialog_class_init (BzPreferencesDialogClass *klass)
gtk_widget_class_bind_template_child (widget_class, BzPreferencesDialog, search_debounce_switch);
gtk_widget_class_bind_template_child (widget_class, BzPreferencesDialog, flag_buttons_box);
gtk_widget_class_bind_template_child (widget_class, BzPreferencesDialog, hide_eol_switch);
gtk_widget_class_bind_template_child (widget_class, BzPreferencesDialog, rotate_switch);
gtk_widget_class_bind_template_callback (widget_class, invert_boolean);
gtk_widget_class_bind_template_callback (widget_class, on_rotate_switch_changed);
}

static void
Expand Down
17 changes: 2 additions & 15 deletions src/bz-transact-icon.c
Original file line number Diff line number Diff line change
Expand Up @@ -299,9 +299,6 @@ apply_state (BzTransactIcon *self)
g_signal_connect_swapped (
self->settings, "changed::global-progress-bar-theme",
G_CALLBACK (pride_flag_changed), self);
g_signal_connect_swapped (
self->settings, "changed::rotate-flag",
G_CALLBACK (pride_flag_changed), self);
}
}
}
Expand Down Expand Up @@ -402,10 +399,7 @@ ensure_draw_css (BzTransactIcon *self)
{
g_autoptr (GtkWidget) widget = NULL;
g_autofree char *id = NULL;
g_autofree char *final_id = NULL;
g_autofree char *class = NULL;
gboolean rotate = FALSE;

widget = bge_wdgt_renderer_lookup_object (self->wdgt, "flag");

if (self->settings == NULL)
Expand All @@ -416,15 +410,8 @@ ensure_draw_css (BzTransactIcon *self)
return;
}

id = g_settings_get_string (self->settings, "global-progress-bar-theme");
rotate = g_settings_get_boolean (self->settings, "rotate-flag");

if (rotate && g_strcmp0 (id, "accent-color") != 0)
final_id = g_strdup_printf ("%s-horizontal", id);
else
final_id = g_strdup (id);

class = bz_dup_css_class_for_pride_id (final_id);
id = g_settings_get_string (self->settings, "global-progress-bar-theme");
class = bz_dup_css_class_for_pride_id (id);

if (self->pride_class != NULL &&
g_strcmp0 (self->pride_class, class) == 0)
Expand Down
Loading