Aperture priority page

This commit is contained in:
Daniele Verducci 2024-04-04 08:54:38 +02:00
parent 9b89dfbfe1
commit fc84751992
6 changed files with 99 additions and 5 deletions

View File

@ -3,6 +3,8 @@
<gresource prefix="/eu/ichibi/Lumos">
<file preprocess="xml-stripblanks">window.ui</file>
<file preprocess="xml-stripblanks">widgets/time_priority_page.ui</file>
<file preprocess="xml-stripblanks">widgets/aperture_priority_page.ui</file>
<file preprocess="xml-stripblanks">gtk/help-overlay.ui</file>
<file compressed="true">style.css</file>
</gresource>
</gresources>

View File

@ -32,6 +32,7 @@ lumos_sources = [
'window.py',
'widgets/widgets_loader.py',
'widgets/time_priority_page.py',
'widgets/aperture_priority_page.py',
]
install_data(lumos_sources, install_dir: moduledir)

View File

@ -0,0 +1,26 @@
# aperture_priority_page.py
#
# Copyright 2024 Daniele Verducci
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: GPL-3.0-or-later
from gi.repository import Adw
from gi.repository import Gtk
@Gtk.Template(resource_path='/eu/ichibi/Lumos/widgets/aperture_priority_page.ui')
class AperturePriorityPage(Gtk.Box):
__gtype_name__ = 'AperturePriorityPage'

View File

@ -0,0 +1,67 @@
<interface>
<requires lib="gtk" version="4.0"/>
<requires lib="adw" version="1.0"/>
<template class="AperturePriorityPage" parent="GtkBox">
<property name="orientation">1</property>
<property name="valign">3</property>
<property name="halign">3</property>
<child>
<object class="GtkImage">
<property name="icon-name">camera-shutter-symbolic</property>
<property name="pixel-size">64</property>
<property name="margin-bottom">30</property>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">Aperture priority</property>
<style>
<class name="title-1"/>
</style>
<property name="margin-bottom">30</property>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">Set this shutter speed:</property>
<property name="margin-bottom">15</property>
</object>
</child>
<child>
<object class="GtkLabel" id="time-priority-aperture-label">
<property name="label" translatable="no">f/60</property>
<style>
<class name="lumos-big-result"/>
</style>
<property name="margin-bottom">30</property>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">Your camera's aperture setting is:</property>
<property name="margin-bottom">15</property>
</object>
</child>
<child>
<object class="GtkDropDown" id="time-priority-speed-dropdown">
<property name="model">
<object class="GtkStringList">
<items>
<item translatable="no">f/ 32</item>
<item translatable="no">f/ 22</item>
<item translatable="no">f/ 16</item>
<item translatable="no">f/ 11</item>
<item translatable="no">f/ 8</item>
<item translatable="no">f/ 5.6</item>
<item translatable="no">f/ 4</item>
<item translatable="no">f/ 2.8</item>
<item translatable="no">f/ 2</item>
<item translatable="no">f/ 1.4</item>
</items>
</object>
</property>
</object>
</child>
</template>
</interface>

View File

@ -1,8 +1,10 @@
from gi.repository import GObject
from .time_priority_page import TimePriorityPage
from .aperture_priority_page import AperturePriorityPage
# Register widgets to be used in templates UI
def registerWidgets() -> None:
GObject.type_ensure(TimePriorityPage)
GObject.type_ensure(AperturePriorityPage)

View File

@ -35,11 +35,7 @@
<property name="icon-name">camera-shutter-symbolic</property>
<property name="use-underline">true</property>
<property name="child">
<object class="GtkLabel" id="aperture-label">
<property name="label" translatable="yes">Aperture priority mode!</property>
<style>
<class name="title-1"/>
</style>
<object class="AperturePriorityPage" id="aperture-priority-page-widget">
</object>
</property>
</object>