-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[feat] Min/Max buttons on the home screen (#22)
* Update dependencies * Improve styling of sliders and buttons
- Loading branch information
1 parent
f8c9334
commit 5cbeb86
Showing
21 changed files
with
141 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
from .level_row import * | ||
from .button_row import * | ||
|
||
import gi | ||
gi.require_version('Gtk', '4.0') | ||
from gi.repository import Gtk | ||
|
||
class BoxflatButtonLevelRow(BoxflatLevelRow): | ||
def __init__(self, title: str, subtitle="", max_value=1000): | ||
super().__init__(title, subtitle, max_value, append_widget=False) | ||
|
||
self._box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL) | ||
# self._box.set_hexpand(True) | ||
self._set_widget(self._box) | ||
self._bar.set_margin_start(10) | ||
self._bar.set_margin_end(0) | ||
|
||
|
||
def add_button(self, button_label: str, callback: callable, *args): | ||
button = Gtk.Button(label=button_label) | ||
button.set_valign(Gtk.Align.CENTER) | ||
button.set_margin_start(10) | ||
self._box.append(button) | ||
button.add_css_class("level-button") | ||
|
||
button.connect('clicked', lambda button: callback(*args)) | ||
|
||
|
||
def insert_bar_now(self): | ||
if not self._bar.get_parent(): | ||
self._box.append(self._bar) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from .button_level_row import * | ||
|
||
class BoxflatMinMaxLevelRow(BoxflatButtonLevelRow): | ||
def __init__(self, title: str, callback: callable, | ||
command_prefix: str, subtitle="", max_value=1000): | ||
super().__init__(title, subtitle, max_value) | ||
|
||
self.set_bar_width(230) | ||
self.add_button("Min", callback, self.get_percent, f"{command_prefix}-min") | ||
self.insert_bar_now() | ||
self.add_button("Max", callback, self.get_percent, f"{command_prefix}-max") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.