Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions data/halftone.gresource.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,8 @@
<file preprocess="xml-stripblanks" alias="image-adjust-size-symbolic.svg">icons/scalable/actions/image-adjust-size-symbolic.svg</file>
<file preprocess="xml-stripblanks" alias="sheet-show-bottom-symbolic.svg">icons/scalable/actions/sheet-show-bottom-symbolic.svg</file>
<file preprocess="xml-stripblanks" alias="sidebar-show-left-symbolic.svg">icons/scalable/actions/sidebar-show-left-symbolic.svg</file>
<file preprocess="xml-stripblanks" alias="zoom-in-symbolic.svg">icons/scalable/actions/zoom-in-symbolic.svg</file>
<file preprocess="xml-stripblanks" alias="zoom-original-symbolic.svg">icons/scalable/actions/zoom-original-symbolic.svg</file>
<file preprocess="xml-stripblanks" alias="zoom-out-symbolic.svg">icons/scalable/actions/zoom-out-symbolic.svg</file>
</gresource>
</gresources>
4 changes: 4 additions & 0 deletions data/icons/scalable/actions/zoom-in-symbolic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions data/icons/scalable/actions/zoom-original-symbolic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions data/icons/scalable/actions/zoom-out-symbolic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 12 additions & 6 deletions data/ui/image_view.blp
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,16 @@ template $HalftoneImageView : Adw.Bin {
]
}

Gtk.Button zoom_reset_button {
icon-name: "zoom-original-symbolic";
tooltip-text: _("Reset Zoom");
action-name: "zoom.best-fit";

styles [
"flat"
]
}

Gtk.Button zoom_in_button {
icon-name: "zoom-in-symbolic";
tooltip-text: _("Zoom In");
Expand All @@ -104,15 +114,11 @@ template $HalftoneImageView : Adw.Bin {
]
}

child: Gtk.ScrolledWindow viewer_scrolled_window {
child: Gtk.ScrolledWindow scrolled_window {
vexpand: true;
hexpand: true;

Gtk.Viewport image_viewport {
scroll-to-focus: false;

child: $HalftoneImage image_widget {};
}
child: $HalftoneImage image_widget {};
};
};
};
Expand Down
5 changes: 5 additions & 0 deletions data/ui/shortcuts_dialog.blp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ Adw.ShortcutsDialog shortcuts_dialog {
accelerator: "<Ctrl>plus plus";
}

Adw.ShortcutsItem {
title: C_("shortcut window", "Reset Zoom");
accelerator: "<Ctrl>0 0";
}

Adw.ShortcutsItem {
title: C_("shortcut window", "Zoom Out");
accelerator: "<Ctrl>minus minus";
Expand Down
4 changes: 2 additions & 2 deletions halftone/views/dither_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ def _set_texture(self, path: str, as_original: bool = False) -> None:

texture = GlyGtk4.frame_get_texture(frame)

current_scale = image_widget.scale
current_zoom = image_widget.zoom
current_scaling_filter = image_widget.scaling_filter

image_widget.texture = texture
Expand All @@ -311,7 +311,7 @@ def _set_texture(self, path: str, as_original: bool = False) -> None:
self.image_options_view.original_texture = texture
else:
self.updated_texture = texture
image_widget.scale = current_scale
image_widget.zoom = current_zoom
image_widget.scaling_filter = current_scaling_filter

def _get_output_format_suffix(self) -> str:
Expand Down
Loading