Skip to content

Make minimap scale (size) user-configurable through PaperWM extension settings#454

Merged
jtaala merged 6 commits intopaperwm:developfrom
PaperWM-redux:minimap-scale-user-configurable
Jan 21, 2023
Merged

Make minimap scale (size) user-configurable through PaperWM extension settings#454
jtaala merged 6 commits intopaperwm:developfrom
PaperWM-redux:minimap-scale-user-configurable

Conversation

@jtaala
Copy link
Copy Markdown
Collaborator

@jtaala jtaala commented Dec 26, 2022

This PR makes the mini-map size user configurable. It also fixes #457 and uses the user defined mini-map scale value for StackOverlay window previews as well.

I prefer the mini-map tile size to be a little larger than the current default (15%). This PR adds a setting to PaperWM extension settings which allows users to select their own mini-map scale setting (from 5% to 95%).

This setting corresponds to the "scale" of mini-map tiles as compared to their actual window size (e.g. "15" corresponds to a mini-map tile size being approximately 15% of the actual window size).

Changes are applied immediately (no need to logout/login etc.).

The default value is set to the original MINIMAP_SCALE value that was defined in minimap.js.

image

independent of MINIMAP_SCALE (preparation for setting scale to user
option).

Added "minimap-scale" to schema (and recompiled schema).  Minimap.js now
uses "prefs.minimap_scale" from schema.

Added "Mini-map scale (size)" GtkSpinButton to settings.ui and
implemented binding in prefs.js.
used scale and clone.width instead of 'get_transformed_size()').
… scale

value for StackOverlay window previews.
@jtaala
Copy link
Copy Markdown
Collaborator Author

jtaala commented Dec 28, 2022

@Gelbana @tadfisher @ccope @smichel17 - here's a new feature to review when someone has time.

This one allows users to set the minimap scale in extension settings.

Note this PR also implements fix #458 and sets the the StackOverlay preview size to the user defined scale.

…ay (in

extension settings) to percentage format (e.g. `30` instead of `0.3`).
@jtaala jtaala marked this pull request as ready for review December 29, 2022 05:59
@jtaala
Copy link
Copy Markdown
Collaborator Author

jtaala commented Dec 29, 2022

@smichel17 to align with the other PRs (like #453 and #456) I've changed the setting value display (in extension settings) to also be percentage format (e.g. 30 instead of 0.30). Internally, we use standard format though (e.g. 0.3).

Cheers!

@jtaala
Copy link
Copy Markdown
Collaborator Author

jtaala commented Jan 21, 2023

All, this has been up and ready to go for 3 weeks - did the invites for comment and haven't heard any complaints etc.

Have been testing this new feature in anger for the past 3 weeks and haven't seen any regressions or issues. Will merge this now.

@jtaala jtaala merged commit b066107 into paperwm:develop Jan 21, 2023
@smichel17
Copy link
Copy Markdown
Member

This looks good to me, no suggestions. I have two comments for the future, though:

  1. The preferences screen is starting to get large. Not to the point where it is a problem, but if/when more settings are added, we'll have to take a pass at organizing them. Next time you want to add a setting, let's have a more detailed discussion. In short, I'm a fan of apps that have more settings than are exposed in their UI (e.g. set them via user.js or directly modifying dconf values, without putting them in the official settings dialog). I think it's a good balance between flexibility and not overwhelming the user when they first open the settings. Firefox's about:config is a good example of this.
    • I think it's good for this to be in the UI but, on reflection, "useful window widths" might be more appropriate to leave as a "hidden" setting, where perhaps we can fix the problem by providing better defaults, instead of asking users to pick their own values.
  2. In the future we might want to make this setting affect the size of other UI elements created by the app, and rename it to something like "UI scale".

@jtaala
Copy link
Copy Markdown
Collaborator Author

jtaala commented Jan 29, 2023

Yeah, good points - this setting seemed simple enough and fit well enough to add it to the "Settings" section (p.s. it used to be called "Toggles").

Re the "Useful window widths/heights" - yeah I struggled a bit with knowing where to stick them... I toyed with creating a new settings section or tab - in the end I thought where they ended up was kind of okay (but not ideal).

@smichel17
Copy link
Copy Markdown
Member

Agreed that it's good enough for now, with how few settings there are. The more settings, the better they need to be organized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Right-side window preview (StackOverlay) is broken / not showing

2 participants