Splitted main layout in widgets, implemented widgets loader
This commit is contained in:
26
src/widgets/time_priority_page.py
Normal file
26
src/widgets/time_priority_page.py
Normal 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/time_priority_page.ui')
|
||||
class TimePriorityPage(Gtk.Box):
|
||||
__gtype_name__ = 'TimePriorityPage'
|
||||
|
76
src/widgets/time_priority_page.ui
Normal file
76
src/widgets/time_priority_page.ui
Normal file
@@ -0,0 +1,76 @@
|
||||
<interface>
|
||||
<requires lib="gtk" version="4.0"/>
|
||||
<requires lib="adw" version="1.0"/>
|
||||
<template class="TimePriorityPage" 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-timer-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">Time 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 aperture value:</property>
|
||||
<property name="margin-bottom">15</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="time-priority-aperture-label">
|
||||
<property name="label" translatable="no">f/11</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 time 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">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>
|
||||
</template>
|
||||
</interface>
|
||||
|
||||
|
8
src/widgets/widgets_loader.py
Normal file
8
src/widgets/widgets_loader.py
Normal file
@@ -0,0 +1,8 @@
|
||||
from gi.repository import GObject
|
||||
|
||||
from .time_priority_page import TimePriorityPage
|
||||
|
||||
# Register widgets to be used in templates UI
|
||||
def registerWidgets() -> None:
|
||||
GObject.type_ensure(TimePriorityPage)
|
||||
|
Reference in New Issue
Block a user