Initial Commit
The initial commit of gnome-image-viewer. Things are in an MVP state, with image viewing and opening from the desktop functional. We also can open images externally, print them, and set them as backgrounds.
This commit is contained in:
commit
f692ab5626
38 changed files with 3807 additions and 0 deletions
47
data/gtk/help_overlay.ui
Normal file
47
data/gtk/help_overlay.ui
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<object class="GtkShortcutsWindow" id="help_overlay">
|
||||
<property name="modal">True</property>
|
||||
<child>
|
||||
<object class="GtkShortcutsSection">
|
||||
<property name="section_name">shortcuts</property>
|
||||
<child>
|
||||
<object class="GtkShortcutsGroup">
|
||||
<property name="title" translatable="yes" context="shortcut window">General Shortcuts</property>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="title" translatable="yes" context="shortcut window">Show Primary Menu</property>
|
||||
<property name="accelerator">F10</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="title" translatable="yes" context="shortcut window">New Window</property>
|
||||
<property name="accelerator"><Primary>n</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="title" translatable="yes" context="shortcut window">Open Help</property>
|
||||
<property name="accelerator">F1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="title" translatable="yes" context="shortcut window">Show Keyboard Shortcuts</property>
|
||||
<property name="accelerator"><Primary>F1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="title" translatable="yes" context="shortcut window">Quit</property>
|
||||
<property name="accelerator"><Primary>q</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
|
||||
99
data/gtk/image_view.ui
Normal file
99
data/gtk/image_view.ui
Normal file
|
|
@ -0,0 +1,99 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<template class="IvImageView" parent="GtkWidget">
|
||||
<property name="css-name">imageview</property>
|
||||
<property name="layout-manager">
|
||||
<object class="GtkBinLayout"/>
|
||||
</property>
|
||||
<child>
|
||||
<object class="GtkOverlay">
|
||||
<property name="hexpand">True</property>
|
||||
<child>
|
||||
<object class="GtkPicture" id="picture">
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">center</property>
|
||||
</object>
|
||||
</child>
|
||||
<child type="overlay">
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkHeaderBar" id="headerbar">
|
||||
<property name="valign">start</property>
|
||||
<property name="show-title-buttons">False</property>
|
||||
<child type="end">
|
||||
<object class="GtkButton">
|
||||
<property name="margin-start">6</property>
|
||||
<property name="has-frame">False</property>
|
||||
<property name="icon-name">view-restore-symbolic</property>
|
||||
<property name="action-name">win.toggle-fullscreen</property>
|
||||
</object>
|
||||
</child>
|
||||
<child type="end">
|
||||
<object class="GtkMenuButton" id="menu_button">
|
||||
<property name="icon-name">open-menu-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
<style>
|
||||
<class name="osd"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="vexpand">True</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="prev_button">
|
||||
<property name="halign">start</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="margin-start">18</property>
|
||||
<property name="margin-end">18</property>
|
||||
<property name="icon-name">go-previous-symbolic</property>
|
||||
<property name="action-name">iv.previous</property>
|
||||
<style>
|
||||
<class name="osd"/>
|
||||
<class name="circular"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="next_button">
|
||||
<property name="hexpand">True</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="margin-start">18</property>
|
||||
<property name="margin-end">18</property>
|
||||
<property name="icon-name">go-next-symbolic</property>
|
||||
<property name="action-name">iv.next</property>
|
||||
<style>
|
||||
<class name="osd"/>
|
||||
<class name="circular"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkGestureClick" id="click_gesture">
|
||||
<property name="button">3</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkGestureLongPress" id="press_gesture">
|
||||
<property name="touch-only">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkPopoverMenu" id="popover">
|
||||
<property name="has-arrow">False</property>
|
||||
</object>
|
||||
</child>
|
||||
<style>
|
||||
<class name="image-view"/>
|
||||
</style>
|
||||
</template>
|
||||
</interface>
|
||||
121
data/gtk/window.ui
Normal file
121
data/gtk/window.ui
Normal file
|
|
@ -0,0 +1,121 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<template class="IvWindow" parent="HdyApplicationWindow">
|
||||
<property name="default-width">600</property>
|
||||
<property name="default-height">498</property>
|
||||
<property name="width-request">360</property>
|
||||
<property name="title">Image Viewer</property>
|
||||
<property name="child">
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkHeaderBar" id="headerbar">
|
||||
<property name="show-title-buttons">True</property>
|
||||
<property name="css-classes">titlebar</property>
|
||||
<child type="end">
|
||||
<object class="GtkMenuButton" id="menu_button">
|
||||
<property name="icon-name">open-menu-symbolic</property>
|
||||
<property name="menu-model">primary_menu</property>
|
||||
</object>
|
||||
</child>
|
||||
<child type="end">
|
||||
<object class="GtkButton">
|
||||
<property name="icon-name">view-fullscreen-symbolic</property>
|
||||
<property name="action-name">win.toggle-fullscreen</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkStack" id="stack">
|
||||
<property name="visible-child">status_page</property>
|
||||
<property name="vexpand">True</property>
|
||||
<child>
|
||||
<object class="HdyStatusPage" id="status_page">
|
||||
<property name="title" translatable="yes">Image Viewer</property>
|
||||
<property name="description" translatable="yes">Click Here Or Drag An Image To View</property>
|
||||
<child>
|
||||
<object class="GtkGestureClick" id="open_gesture"/>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="IvImageView" id="image_view">
|
||||
<property name="primary-menu-model">primary_menu</property>
|
||||
<property name="popover-menu-model">image_menu</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</template>
|
||||
<menu id="primary_menu">
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_New Window</attribute>
|
||||
<attribute name="action">app.new-window</attribute>
|
||||
</item>
|
||||
</section>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_Open With…</attribute>
|
||||
<attribute name="action">win.open-with</attribute>
|
||||
</item>
|
||||
<!--<item>
|
||||
<attribute name="label" translatable="yes">_Display On…</attribute>
|
||||
<attribute name="action">win.display-on</attribute>
|
||||
</item>-->
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_Print…</attribute>
|
||||
<attribute name="action">win.print</attribute>
|
||||
</item>
|
||||
<!--<item>
|
||||
<attribute name="label" translatable="yes">_Rotate</attribute>
|
||||
<attribute name="action">win.rotate-image</attribute>
|
||||
</item>-->
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_Set As Wallpaper</attribute>
|
||||
<attribute name="action">win.set-wallpaper</attribute>
|
||||
</item>
|
||||
</section>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_Help</attribute>
|
||||
<attribute name="action">app.help</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_Keyboard Shortcuts</attribute>
|
||||
<attribute name="action">win.show-help-overlay</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_About Image Viewer</attribute>
|
||||
<attribute name="action">app.about</attribute>
|
||||
</item>
|
||||
</section>
|
||||
</menu>
|
||||
<menu id="image_menu">
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_Open With…</attribute>
|
||||
<attribute name="action">win.open-with</attribute>
|
||||
</item>
|
||||
<!--<item>
|
||||
<attribute name="label" translatable="yes">_Display On…</attribute>
|
||||
<attribute name="action">win.display-on</attribute>
|
||||
</item>-->
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_Print…</attribute>
|
||||
<attribute name="action">win.print</attribute>
|
||||
</item>
|
||||
<!--<item>
|
||||
<attribute name="label" translatable="yes">_Rotate</attribute>
|
||||
<attribute name="action">win.rotate-image</attribute>
|
||||
</item>-->
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_Set As Wallpaper</attribute>
|
||||
<attribute name="action">win.set-wallpaper</attribute>
|
||||
</item>
|
||||
</section>
|
||||
</menu>
|
||||
</interface>
|
||||
Loading…
Add table
Add a link
Reference in a new issue