Skip to content

Commit

Permalink
Add nav buttons to action bar at small sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
kra-mo committed Dec 22, 2023
1 parent a1660ff commit 5bd6c85
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 6 deletions.
28 changes: 24 additions & 4 deletions hyperplane/gtk/window.blp
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ menu primary_menu {
}

template $HypWindow : Adw.ApplicationWindow {
width-request: 281;
height-request: 126;
width-request: 194;
height-request: 146;
content:
Adw.TabOverview tab_overview {
view: tab_view;
Expand Down Expand Up @@ -193,14 +193,14 @@ template $HypWindow : Adw.ApplicationWindow {
}

[start]
Button {
Button header_bar_back {
icon-name: "go-previous-symbolic";
action-name: "win.back";
tooltip-text: _("Back");
}

[start]
Button {
Button header_bar_forward {
icon-name: "go-next-symbolic";
action-name: "win.forward";
tooltip-text: _("Forward");
Expand Down Expand Up @@ -246,8 +246,25 @@ template $HypWindow : Adw.ApplicationWindow {
view: tab_view;
}


Adw.TabView tab_view {
}

[bottom]
ActionBar action_bar {
revealed: false;
Button {
icon-name: "go-previous-symbolic";
action-name: "win.back";
tooltip-text: _("Back");
}

Button {
icon-name: "go-next-symbolic";
action-name: "win.forward";
tooltip-text: _("Forward");
}
}
}

;
Expand All @@ -267,6 +284,9 @@ template $HypWindow : Adw.ApplicationWindow {
overlay_split_view.collapsed: true;
show_sidebar_button.visible: true;
hide_sidebar_button.visible: true;
header_bar_back.visible: false;
header_bar_forward.visible: false;
action_bar.revealed: true;
}
}
}
Expand Down
5 changes: 3 additions & 2 deletions hyperplane/item.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ def __thumbnail_cb(self, texture: Optional[Gdk.Texture] = None) -> None:
def __zoom(self, _obj: Any, zoom_level: int) -> None:
self.clamp.set_maximum_size(50 * zoom_level)

box_margin = zoom_level * 4
box_margin = zoom_level * 3
self.box.set_margin_start(box_margin)
self.box.set_margin_end(box_margin)
self.box.set_margin_top(box_margin)
Expand All @@ -355,7 +355,8 @@ def __zoom(self, _obj: Any, zoom_level: int) -> None:
match zoom_level:
case 1:
# This is not the exact aspect ratio, but it is close enough.
# It's good for keeping the folder textures sharp
# It's good for keeping the folder textures sharp.
# Or not apparently. Whether they are sharp seems really random.
self.thumbnail.set_size_request(96, 74)
case 2:
self.thumbnail.set_size_request(96, 96)
Expand Down

0 comments on commit 5bd6c85

Please sign in to comment.