mirror of
https://github.com/libratbag/piper.git
synced 2026-02-20 07:33:50 -05:00
* Add dpi_entry GtkEntry objects to UI file and Python. Find and apply closest resolution in self.resolutions. [Needed?] Store value on textbox focus in. [Needed?] Do not apply DPI value if the same as previous value. DPI entry and resolution sliders affect each others' values. * Remove pointless recursive logic. Remove focus methods. * Calculate DPI text box width based on max supported resolution. * Renamed methods/signals to be consistent with current convention. * Add a 'focus-in-event' signal to the DPI entry field. Pass reference to ResolutionsPage when initialising ResolutionRow. Use reference to invoke `ResolutionsPage._on_row_activated()`. Do not toggle Revealer on DPI entry text box focus-in-event if Revealer is already expanded. Grammar: dpi -> DPI * Add type hints. Prefix unused vars with underscores. Actioned suggested import order from linter. * Actually apply the closest res value (oops). Apply the res value on focus-out-event. * Toggle allow editing of DPI entry if 'disable' button clicked. * Use set_sensitive() on DPI entry. * rm pointless var. * Create custom class for DPI text entry to circumvent assertion warning. Grab DPIEntry focus when revealing ResolutionRow. Revert import order. Removed unused 'previous DPI value' var. Remove 'private' convention underscore from ResolutionsPage._on_row_activate(). Remove callback method for DPI entry on ResolutionRow. UI file uses DPIEntry. Remove insert-text signal for DPIEntry from UI file. * Line lengths * Removed unused import. Underscored unused parameter (PEP convention). * Reverted underscore convention as to not break existing stuff. * Use underscore convention, but also use it when invoking the method. * Renamed handler name for ResolutionsPage to match method. * Clarified docstring. --------- Co-authored-by: Dan <64416644+brittle-bones@users.noreply.github.com>
102 lines
4.7 KiB
XML
102 lines
4.7 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!-- Generated with glade 3.40.0 -->
|
|
<interface>
|
|
<requires lib="gtk+" version="3.22"/>
|
|
<template class="ResolutionsPage" parent="GtkBox">
|
|
<property name="visible">True</property>
|
|
<property name="can-focus">False</property>
|
|
<child>
|
|
<object class="GtkBox">
|
|
<property name="width-request">300</property>
|
|
<property name="visible">True</property>
|
|
<property name="can-focus">False</property>
|
|
<property name="border-width">20</property>
|
|
<property name="orientation">vertical</property>
|
|
<child>
|
|
<object class="GtkFrame">
|
|
<property name="visible">True</property>
|
|
<property name="can-focus">False</property>
|
|
<property name="label-xalign">0</property>
|
|
<property name="shadow-type">none</property>
|
|
<child>
|
|
<object class="GtkScrolledWindow">
|
|
<property name="visible">True</property>
|
|
<property name="can-focus">True</property>
|
|
<property name="margin-start">12</property>
|
|
<property name="margin-end">12</property>
|
|
<property name="margin-top">12</property>
|
|
<property name="margin-bottom">12</property>
|
|
<property name="shadow-type">in</property>
|
|
<property name="propagate-natural-width">True</property>
|
|
<property name="propagate-natural-height">True</property>
|
|
<child>
|
|
<object class="GtkViewport">
|
|
<property name="visible">True</property>
|
|
<property name="can-focus">False</property>
|
|
<child>
|
|
<object class="GtkListBox" id="listbox">
|
|
<property name="visible">True</property>
|
|
<property name="can-focus">False</property>
|
|
<property name="selection-mode">none</property>
|
|
<signal name="row-activated" handler="on_row_activated" swapped="no"/>
|
|
<child>
|
|
<object class="GtkListBoxRow" id="add_resolution_row">
|
|
<property name="can-focus">True</property>
|
|
<property name="tooltip-text" translatable="yes">Add a new resolution to the profile</property>
|
|
<child>
|
|
<object class="GtkBox">
|
|
<property name="visible">True</property>
|
|
<property name="can-focus">False</property>
|
|
<property name="hexpand">True</property>
|
|
<property name="border-width">6</property>
|
|
<child type="center">
|
|
<object class="GtkImage">
|
|
<property name="visible">True</property>
|
|
<property name="can-focus">False</property>
|
|
<property name="icon-name">list-add-symbolic</property>
|
|
</object>
|
|
<packing>
|
|
<property name="expand">False</property>
|
|
<property name="fill">True</property>
|
|
<property name="position">0</property>
|
|
</packing>
|
|
</child>
|
|
</object>
|
|
</child>
|
|
</object>
|
|
</child>
|
|
</object>
|
|
</child>
|
|
</object>
|
|
</child>
|
|
</object>
|
|
</child>
|
|
<child type="label">
|
|
<object class="GtkLabel">
|
|
<property name="visible">True</property>
|
|
<property name="can-focus">False</property>
|
|
<property name="label" translatable="yes">Resolutions</property>
|
|
<property name="track-visited-links">False</property>
|
|
<attributes>
|
|
<attribute name="weight" value="bold"/>
|
|
</attributes>
|
|
</object>
|
|
</child>
|
|
</object>
|
|
<packing>
|
|
<property name="expand">False</property>
|
|
<property name="fill">True</property>
|
|
<property name="position">1</property>
|
|
</packing>
|
|
</child>
|
|
</object>
|
|
<packing>
|
|
<property name="expand">False</property>
|
|
<property name="fill">True</property>
|
|
<property name="pack-type">end</property>
|
|
<property name="position">1</property>
|
|
</packing>
|
|
</child>
|
|
</template>
|
|
</interface>
|