Manual exposure page

This commit is contained in:
Daniele Verducci 2024-04-10 08:07:39 +02:00
parent fc84751992
commit b71c74e7f1
7 changed files with 158 additions and 6 deletions

View File

@ -4,6 +4,7 @@
<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">widgets/manual_exposure_page.ui</file>
<file preprocess="xml-stripblanks">gtk/help-overlay.ui</file>
<file compressed="true">style.css</file>
</gresource>

View File

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

View File

@ -43,7 +43,7 @@
</object>
</child>
<child>
<object class="GtkDropDown" id="time-priority-speed-dropdown">
<object class="GtkDropDown" id="aperture-priority-speed-dropdown">
<property name="model">
<object class="GtkStringList">
<items>

View File

@ -0,0 +1,26 @@
# time_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/manual_exposure_page.ui')
class ManualExposurePage(Gtk.Box):
__gtype_name__ = 'ManualExposurePage'

View File

@ -0,0 +1,126 @@
<interface>
<requires lib="gtk" version="4.0"/>
<requires lib="adw" version="1.0"/>
<template class="ManualExposurePage" 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">encoder-knob-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">Manual exposure</property>
<style>
<class name="title-1"/>
</style>
<property name="margin-bottom">30</property>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">Exposure:</property>
<property name="margin-bottom">15</property>
</object>
</child>
<child>
<object class="GtkProgressBar" id="first">
<property name="fraction">0.5</property>
<property name="show-text">false</property>
<property name="margin-bottom">5</property>
</object>
</child>
<child>
<object class="GtkBox">
<property name="orientation">0</property>
<property name="halign">0</property>
<property name="margin-bottom">20</property>
<child>
<object class="GtkImage">
<property name="icon-name">encoder-knob-symbolic</property>
<property name="pixel-size">16</property>
</object>
</child>
<child>
<object class="GtkImage">
<property name="icon-name">encoder-knob-symbolic</property>
<property name="pixel-size">16</property>
<property name="hexpand">true</property>
</object>
</child>
<child>
<object class="GtkImage">
<property name="icon-name">encoder-knob-symbolic</property>
<property name="pixel-size">16</property>
</object>
</child>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">Shutter speed:</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">1/ 4000</item>
<item translatable="no">1/ 2000</item>
<item translatable="no">1/ 1000</item>
<item translatable="no">1/ 500</item>
<item translatable="no">1/ 250</item>
<item translatable="no">1/ 125</item>
<item translatable="no">1/ 60</item>
<item translatable="no">1/ 30</item>
<item translatable="no">1/ 15</item>
<item translatable="no">1/ 8</item>
<item translatable="no">1/ 4</item>
<item translatable="no">1/ 2</item>
<item translatable="no">1 sec</item>
<item translatable="no">2 sec</item>
<item translatable="no">4 sec</item>
<item translatable="no">8 sec</item>
<item translatable="no">15 sec</item>
<item translatable="no">30 sec</item>
</items>
</object>
</property>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">Aperture:</property>
<property name="margin-top">20</property>
<property name="margin-bottom">15</property>
</object>
</child>
<child>
<object class="GtkDropDown" id="aperture-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

@ -2,9 +2,11 @@ from gi.repository import GObject
from .time_priority_page import TimePriorityPage
from .aperture_priority_page import AperturePriorityPage
from .manual_exposure_page import ManualExposurePage
# Register widgets to be used in templates UI
def registerWidgets() -> None:
GObject.type_ensure(TimePriorityPage)
GObject.type_ensure(AperturePriorityPage)
GObject.type_ensure(ManualExposurePage)

View File

@ -63,11 +63,7 @@
<property name="icon-name">encoder-knob-symbolic</property>
<property name="use-underline">true</property>
<property name="child">
<object class="GtkLabel" id="manual-label">
<property name="label" translatable="yes">Manual mode!</property>
<style>
<class name="title-1"/>
</style>
<object class="ManualExposurePage" id="manual-page">
</object>
</property>
</object>