Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Terminal window configured by pixel size #2267

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

adamm-xyz
Copy link

This change will allow the user to configure the size of the terminal window with pixel dimensions rather than solely using the sliding scales for height and width. The scale and spin box widgets are updated to reflect each other's change real time. A few new changes needed to be made to the settings schema in order for this to work.

Also this should fix issue #2019

Copy link
Collaborator

@Davidy22 Davidy22 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry it took me so long to get back to you on this, been a little busy lately.

Currently this PR seems to default to using 100x100 pixel dimensions, which is going to be jarring for the user. Probably would be better to set the pixel dimensions from the existing percentages and monitor dimensions for first run instead of setting default starting dimensions to 100x100. Since you have minimums set maybe can set the pixel width/height to 0/0 at start and if the pixel dimensions are out of range, which they will be if you set them to be 0/0 initially, then calculate pixel dimensions.

Alternately, we could just skip saving seperate values for pixel dimensions entirely and do the scale calculation every time we populate/use the spin box. That'd save on stuff like the redundant size setting that would make us have to do extra logic in load_configs() and set_final_window_rect() and we can cut some extra settings in gschema too.

@@ -68,11 +68,23 @@
<property name="step-increment">1</property>
<property name="page-increment">10</property>
</object>
<object class="GtkAdjustment" id="window_horizontal_dimension_adjustment">
<property name="lower">100</property>
<property name="upper">5000</property>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just on a quick check in my display settings, the width numbers do go up to 5120 and I do suspect there's panoramic monitors out there that push the possible upper bound to silly levels. Is it necessary to have upper/lower bounds? I guess lower bounds are naturally needed because guake would become unusable at certain sizes but monitors and monitor resolutions are just going to get bigger.

<description>Resolution of the screen that will be used by guake terminal vertically.</description>
</key>
<key name="max-window-pixel-width" type="i">
<default>1920</default>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this just be determined by the monitor settings?

settings.general.set_int("max-window-pixel-height",total_height)
settings.general.set_int("max-window-pixel-width",total_width)

if not update_by_scale:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we want to update percentage and pixel dimensions in unison, not sure why we would want our recorded percentage and pixel dimensions to be different at any point.

@@ -1148,6 +1181,14 @@ def load_configs(self):
value = self.settings.general.get_int("window-width")
self.get_widget("window_width").set_value(value)

value = self.settings.general.get_int("window-pixel-height")
max_value = self.settings.general.get_int("max-window-pixel-height")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The placement of this just makes the previous block of code effectively dead. See primary comment.

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.

2 participants