Skip to content

Commit

Permalink
Fix selection, finally
Browse files Browse the repository at this point in the history
  • Loading branch information
lainsce committed Aug 21, 2024
1 parent 9d9fc0f commit b558bbc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
12 changes: 7 additions & 5 deletions fuses/appearance/Views/AppearanceView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ public class AppearanceView : Gtk.Box {
private AccentColorButton purple;
private AccentColorButton red;
private AccentColorButton yellow;
private EnsorFlowBox ensor_flowbox;

public Gtk.ScrolledWindow sw;
public Gtk.Stack contrast_stack;
Expand All @@ -33,6 +32,7 @@ public class AppearanceView : Gtk.Box {
public He.ContentBlockImage wallpaper_preview;

public Appearance.WallpaperGrid wallpaper_view;
public EnsorFlowBox ensor_flowbox;

private uint rscale_timeout;

Expand Down Expand Up @@ -259,6 +259,9 @@ public class AppearanceView : Gtk.Box {
accent_box.sensitive = false;
accent_setup.begin ();

var sel = fusebox_appearance_settings.get_int ("wallpaper-accent-choice");
ensor_flowbox.flowbox.select_child (ensor_flowbox.flowbox.get_child_at_index (sel));

multi.set_active (false);
red.set_active (false);
yellow.set_active (false);
Expand Down Expand Up @@ -491,13 +494,12 @@ public class AppearanceView : Gtk.Box {
}

ensor_flowbox = new EnsorFlowBox (argb_ints);

var sel = fusebox_appearance_settings.get_int ("wallpaper-accent-choice");
ensor_flowbox.flowbox.select_child (ensor_flowbox.flowbox.get_child_at_index (sel));

color_sw.set_child (ensor_flowbox);
}

var sel = ((int)Math.floor (fusebox_appearance_settings.get_int ("wallpaper-accent-choice") / 4));
tau_appearance_settings.set_string ("accent-color", He.hexcode_argb (argb_ints[sel]));

loop.quit ();
});
loop.run ();
Expand Down
4 changes: 2 additions & 2 deletions fuses/appearance/Widgets/EnsorFlowBox.vala
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ public class EnsorFlowBox : He.Bin {
valign = Gtk.Align.CENTER,
column_spacing = 12,
homogeneous = true,
min_children_per_line = 20,
max_children_per_line = 20,
min_children_per_line = color.length * 4,
max_children_per_line = color.length * 4,
margin_start = 6,
margin_end = 6,
margin_bottom = 18
Expand Down
4 changes: 3 additions & 1 deletion fuses/appearance/Widgets/WallpaperGrid.vala
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,10 @@ public class Appearance.WallpaperGrid : Gtk.Grid {

settings.set_string ("picture-uri", furi);
settings.set_string ("picture-uri-dark", furi);
if (appearance_view.wallpaper_type_button.active)
if (appearance_view.wallpaper_type_button.active) {
appearance_view.accent_setup.begin ();
appearance_view.ensor_flowbox.flowbox.select_child (appearance_view.ensor_flowbox.flowbox.get_child_at_index (0));
}

appearance_view.wallpaper_preview.file = furi;
appearance_view.wallpaper_lock_preview.file = furi;
Expand Down

0 comments on commit b558bbc

Please sign in to comment.