transparent-window-moving icon indicating copy to clipboard operation
transparent-window-moving copied to clipboard

New settings style and localization

Open Katy248 opened this issue 1 year ago • 3 comments

I moved settings to Adw.PreferenceRow.

I also fixed localization and added Russian translation

Katy248 avatar Jun 28 '24 19:06 Katy248

This is great! This is a nice update as it's a much cleaner look using Adw controls for the prefrences.

Screenshot from 2025-02-20 13-51-16

I think this could be refined a bit more by removing the listbox and just adding the switchRow and spinRow controls directly to the page. A couple benefits include removing the ability to select/highlight a listbox item as this is not needed if you're not selecting an item from a list, and allowing the user to tab through all the controls and cycle back to the top after the last control.

Modifying the fillPreferencesWindow and removing buildPrefsWidget has this working for me:

    fillPreferencesWindow(window) {
        const page = new Adw.PreferencesPage();
        const group = new Adw.PreferencesGroup({
            title: _("Settings"),
        });
    
        let settings = this.getSettings();
    
        group.add(this.buildSpin(settings, "window-opacity", [0, 255, 5, 50, 0], _("Opacity (0..255)")));
        group.add(this.buildSpin(settings, "transition-time", [0, 1, 0.1, 0, 2], _("Animation time")));
        group.add(this.buildSwitcher(settings, "transparent-on-moving", _("Transparent on moving")));
        group.add(this.buildSwitcher(settings, "transparent-on-resizing", _("Transparent on resizing")));
    
        page.add(group);
        window.add(page);
    }

StorageB avatar Feb 20 '25 20:02 StorageB

I think this could be refined a bit more by removing the listbox and just adding the switchRow and spinRow controls directly to the page. A couple benefits include removing the ability to select/highlight a listbox item as this is not needed if you're not selecting an item

Thanks for your advice! I simply didn't know how Adw.PreferencesGroup works

Katy248 avatar Feb 21 '25 08:02 Katy248

This looks great! The updates are working well for me (running Ubuntu 24.04).

StorageB avatar Feb 21 '25 22:02 StorageB