Skip to content

Commit

Permalink
Merge branch 'main' into danirabbit/new-a11y
Browse files Browse the repository at this point in the history
  • Loading branch information
danirabbit authored May 6, 2024
2 parents e70f403 + a16f254 commit e9422f7
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 25 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ You'll need the following dependencies:
* libgee-0.8-dev
* libgexiv2-dev
* libgtk-4-dev (>=4.8)
* libgranite-7-dev (>=7.4.0)
* libgranite-7-dev (>=7.5.0)
* meson
* valac

Expand Down
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ add_project_arguments(
gio_dep = dependency('gio-2.0')
glib_dep = dependency('glib-2.0')
gobject_dep = dependency('gobject-2.0')
granite_dep = dependency('granite-7', version: '>=7.4.0')
granite_dep = dependency('granite-7', version: '>=7.5.0')
gtk_dep = dependency('gtk4', version: '>=4.8')
hdy_dep = dependency ('libadwaita-1')
posix_dep = meson.get_compiler('vala').find_library('posix')
Expand Down
8 changes: 2 additions & 6 deletions src/Plug.vala
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public class PantheonShell.Plug : Switchboard.Plug {
if (main_grid == null) {
wallpaper_view = new Wallpaper (this);

var dock = new Dock ();
var multitasking = new Multitasking ();
var appearance = new Appearance ();
var text = new Text ();
Expand All @@ -64,12 +65,7 @@ public class PantheonShell.Plug : Switchboard.Plug {
stack.add_titled (wallpaper_view, "wallpaper", _("Wallpaper"));
stack.add_titled (appearance, "appearance", _("Appearance"));
stack.add_titled (text, "text", _("Text"));

if (GLib.Environment.find_program_in_path ("plank") != null) {
var dock = new Dock ();
stack.add_titled (dock, "dock", _("Dock & Panel"));
}

stack.add_titled (dock, "dock", _("Dock & Panel"));
stack.add_titled (multitasking, "multitasking", _("Multitasking"));

var stack_switcher = new Gtk.StackSwitcher () {
Expand Down
5 changes: 2 additions & 3 deletions src/Views/Appearance.vala
Original file line number Diff line number Diff line change
Expand Up @@ -428,9 +428,8 @@ public class PantheonShell.Appearance : Gtk.Box {
}

construct {
unowned Gtk.StyleContext context = get_style_context ();
context.add_class (Granite.STYLE_CLASS_COLOR_BUTTON);
context.add_class (color.to_string ());
add_css_class (Granite.STYLE_CLASS_COLOR_BUTTON);
add_css_class (color.to_string ());

realize.connect (() => {
active = color == pantheon_act.prefers_accent_color;
Expand Down
11 changes: 5 additions & 6 deletions src/Views/Multitasking.vala
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class PantheonShell.Multitasking : Gtk.Box {
halign = Gtk.Align.START,
margin_bottom = 6
};
hotcorner_title.get_style_context ().add_class (Granite.STYLE_CLASS_H4_LABEL);
hotcorner_title.add_css_class (Granite.STYLE_CLASS_H4_LABEL);

var topleft = new HotcornerControl (_("Top Left"), "topleft");
var topright = new HotcornerControl (_("Top Right"), "topright");
Expand Down Expand Up @@ -105,11 +105,10 @@ public class PantheonShell.Multitasking : Gtk.Box {
wrap_mode = Pango.WrapMode.WORD_CHAR
};

unowned var label_style_context = label.get_style_context ();
label_style_context.add_class (Granite.STYLE_CLASS_CARD);
label_style_context.add_class (Granite.STYLE_CLASS_ROUNDED);
label_style_context.add_class ("hotcorner");
label_style_context.add_class (position);
label.add_css_class (Granite.STYLE_CLASS_CARD);
label.add_css_class (Granite.STYLE_CLASS_ROUNDED);
label.add_css_class ("hotcorner");
label.add_css_class (position);

var combo = new Gtk.ComboBoxText () {
hexpand = true,
Expand Down
2 changes: 1 addition & 1 deletion src/Views/Wallpaper.vala
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ public class PantheonShell.Wallpaper : Gtk.Box {
undo_removal ();
});

toast.closed.connect (confirm_removal);
toast.dismissed.connect (confirm_removal);

view_overlay.add_overlay (toast);
toast.send_notification ();
Expand Down
9 changes: 2 additions & 7 deletions src/Widgets/WallpaperContainer.vala
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ public class PantheonShell.WallpaperContainer : Gtk.FlowBoxChild {
public string uri { get; construct; }
public uint64 creation_date = 0;

private int scale;

public bool checked {
get {
return Gtk.StateFlags.CHECKED in get_state_flags ();
Expand Down Expand Up @@ -70,10 +68,7 @@ public class PantheonShell.WallpaperContainer : Gtk.FlowBoxChild {
}

construct {
var style_context = get_style_context ();
style_context.add_class ("wallpaper-container");

scale = style_context.get_scale ();
add_css_class ("wallpaper-container");

image = new Gtk.Picture () {
content_fit = COVER,
Expand Down Expand Up @@ -167,7 +162,7 @@ public class PantheonShell.WallpaperContainer : Gtk.FlowBoxChild {
}

private void generate_and_load_thumb () {
ThumbnailGenerator.get_default ().get_thumbnail (uri, THUMB_WIDTH * scale, () => {
ThumbnailGenerator.get_default ().get_thumbnail (uri, THUMB_WIDTH * scale_factor, () => {
try {
var file = File.new_for_uri (uri);
var info = file.query_info (FileAttribute.THUMBNAIL_PATH + "," + FileAttribute.THUMBNAIL_IS_VALID, 0);
Expand Down

0 comments on commit e9422f7

Please sign in to comment.