refactor(core): rename APP_NAME to 'modus', cleanup shared widgets
- Change APP_NAME from 'modus1' to 'modus' in shared/data.py - Remove unused flat_scale widget - Add missing imports in animator and customrevealer - Delete src/utils/uinput.py (unused) - Remove unused import in utils/functions.py
This commit is contained in:
7 files changed
+4
-112
No files matched your search
+1
-1
@@ -4,7 +4,7 @@ from utils.functions import parse_timeout_string
|
||||
from utils.utils import toml_file
|
||||
|
||||
HOME_DIR = GLib.get_home_dir()
|
||||
APP_NAME = "modus1"
|
||||
APP_NAME = "modus"
|
||||
|
||||
CACHE_DIR = str(GLib.get_user_cache_dir()) + f"/{APP_NAME}"
|
||||
|
||||
|
||||
@@ -172,6 +172,7 @@ class Animator(Service):
|
||||
self._max_value = 1.0
|
||||
self._repeat = False
|
||||
self._duration = 0.8
|
||||
self._bezier_curve = (1, 1, 0, 0)
|
||||
self._timing_function = timing_function
|
||||
self._tick_widget = tick_widget
|
||||
self._tick_interval = tick_interval
|
||||
|
||||
@@ -21,6 +21,7 @@ class SlideRevealer(Gtk.Overlay):
|
||||
self.duration = duration
|
||||
self.fixed_size = size
|
||||
self._revealed = False
|
||||
self._show_animation = False
|
||||
self._cached_dimensions = None
|
||||
|
||||
self.animator = Animator(
|
||||
|
||||
@@ -8,10 +8,6 @@ from gi.repository import Pango, PangoCairo
|
||||
|
||||
from shared.widgets.animator import Animator, ease_in, ease_in_out, ease_out
|
||||
|
||||
# ------------------------------------------------------------------ #
|
||||
# Helpers #
|
||||
# ------------------------------------------------------------------ #
|
||||
|
||||
|
||||
def _draw_rounded_rect(cr, x, y, w, h, r):
|
||||
r = min(r, w / 2, h / 2)
|
||||
@@ -31,11 +27,6 @@ def _draw_rounded_rect(cr, x, y, w, h, r):
|
||||
cr.close_path()
|
||||
|
||||
|
||||
# ------------------------------------------------------------------ #
|
||||
# TypedDict #
|
||||
# ------------------------------------------------------------------ #
|
||||
|
||||
|
||||
class FlatScaleStyle(TypedDict):
|
||||
slider_color: Gdk.RGBA
|
||||
slider_height: float
|
||||
@@ -52,11 +43,6 @@ class FlatScaleStyle(TypedDict):
|
||||
background_color: Gdk.RGBA
|
||||
|
||||
|
||||
# ------------------------------------------------------------------ #
|
||||
# Widget #
|
||||
# ------------------------------------------------------------------ #
|
||||
|
||||
|
||||
class FlatScale(Gtk.DrawingArea, Widget):
|
||||
"""
|
||||
A Cairo-drawn linear scale widget for Fabric.
|
||||
@@ -232,10 +218,6 @@ class FlatScale(Gtk.DrawingArea, Widget):
|
||||
if on_value_changed:
|
||||
self.connect("value-changed", on_value_changed)
|
||||
|
||||
# ------------------------------------------------------------------ #
|
||||
# Value #
|
||||
# ------------------------------------------------------------------ #
|
||||
|
||||
@property
|
||||
def value(self) -> float:
|
||||
return self._value
|
||||
@@ -254,10 +236,6 @@ class FlatScale(Gtk.DrawingArea, Widget):
|
||||
def get_value(self) -> float:
|
||||
return self._value
|
||||
|
||||
# ------------------------------------------------------------------ #
|
||||
# Realize / gadget contexts #
|
||||
# ------------------------------------------------------------------ #
|
||||
|
||||
def _on_realize(self, _widget) -> None:
|
||||
state = self.get_state_flags()
|
||||
self._gadget_classes[self._slider_ctx] = None
|
||||
@@ -298,10 +276,6 @@ class FlatScale(Gtk.DrawingArea, Widget):
|
||||
self._cached_style = None
|
||||
self.queue_draw()
|
||||
|
||||
# ------------------------------------------------------------------ #
|
||||
# Style resolution #
|
||||
# ------------------------------------------------------------------ #
|
||||
|
||||
def do_get_border_width(
|
||||
self, context: Gtk.StyleContext, state: Gtk.StateFlags
|
||||
) -> float:
|
||||
@@ -361,10 +335,6 @@ class FlatScale(Gtk.DrawingArea, Widget):
|
||||
|
||||
return self._min_value + ratio * (self._max_value - self._min_value)
|
||||
|
||||
# ------------------------------------------------------------------ #
|
||||
# Bubble animation helpers #
|
||||
# ------------------------------------------------------------------ #
|
||||
|
||||
def _bubble_open(self):
|
||||
self._bubble_closing = False
|
||||
self._anim_bubble_close.pause()
|
||||
@@ -396,10 +366,6 @@ class FlatScale(Gtk.DrawingArea, Widget):
|
||||
else:
|
||||
self._bubble_progress = min(1.0, self._anim_bubble_open.value)
|
||||
|
||||
# ------------------------------------------------------------------ #
|
||||
# Drawing helpers #
|
||||
# ------------------------------------------------------------------ #
|
||||
|
||||
def do_draw_rounded_rect(self, cr, x, y, width, height, radius):
|
||||
_draw_rounded_rect(cr, x, y, width, height, radius)
|
||||
|
||||
@@ -495,10 +461,6 @@ class FlatScale(Gtk.DrawingArea, Widget):
|
||||
|
||||
cr.restore()
|
||||
|
||||
# ------------------------------------------------------------------ #
|
||||
# Main draw #
|
||||
# ------------------------------------------------------------------ #
|
||||
|
||||
def do_draw(self, cr: cairo.Context) -> bool:
|
||||
styles = self.do_resolve_style()
|
||||
|
||||
@@ -622,10 +584,6 @@ class FlatScale(Gtk.DrawingArea, Widget):
|
||||
|
||||
return False
|
||||
|
||||
# ------------------------------------------------------------------ #
|
||||
# Input events #
|
||||
# ------------------------------------------------------------------ #
|
||||
|
||||
def _on_button_press(self, _widget, event: Gdk.EventButton) -> bool:
|
||||
if event.button == 1:
|
||||
self._dragging = True
|
||||
|
||||
Reference in new issue
Block a user