From 93f88b2e394e442d378674a21c5913a1619a171a Mon Sep 17 00:00:00 2001
From: Romanin <60302782+romanin-rf@users.noreply.github.com>
Date: Mon, 11 Dec 2023 08:49:46 +0200
Subject: [PATCH 1/5] Unrelease 11.12.2023:8.50
- Added widgets: `Rheostat`, `ClickableLabel`
---
seaplayer/css/objects.tcss | 35 +++++++++++++++++++++++-
seaplayer/objects/Labels.py | 50 +++++++++++++++++++++++++++++++----
seaplayer/objects/Rheostat.py | 9 +++----
seaplayer/objects/__init__.py | 4 +--
4 files changed, 85 insertions(+), 13 deletions(-)
diff --git a/seaplayer/css/objects.tcss b/seaplayer/css/objects.tcss
index b5537b2..b2a7ac1 100644
--- a/seaplayer/css/objects.tcss
+++ b/seaplayer/css/objects.tcss
@@ -22,11 +22,18 @@ IndeterminateProgress { height: 1; }
/* ! Rheostat */
RheostatBar { height: 1; }
-Rheostat { height: 4; }
+Rheostat {
+ height: 2;
+ align-vertical: middle;
+}
Rheostat Horizontal {
align-horizontal: center;
width: 1fr;
}
+Rheostat Horizontal ClickableLabel {
+ width: 1;
+ height: 1;
+}
/* ! Image Label */
StandartImageLabel {
@@ -115,5 +122,31 @@ FillLabel {
width: 1fr;
}
+/* Clickable Label */
+ClickableLabel {
+ width: auto;
+ min-width: 1;
+ height: auto;
+ min-height: 1;
+ color: $text;
+ background: $panel;
+ text-style: bold;
+ text-align: center;
+ content-align: center middle;
+}
+
+ClickableLabel:focus {
+ text-style: bold reverse;
+}
+
+ClickableLabel:hover {
+ color: $text;
+}
+
+ClickableLabel.-active {
+ background: $panel;
+ tint: $background 30%;
+}
+
/* ! Any Elements CSS */
.pass-one-width { width: 1; }
\ No newline at end of file
diff --git a/seaplayer/objects/Labels.py b/seaplayer/objects/Labels.py
index c8f7445..2a292f5 100644
--- a/seaplayer/objects/Labels.py
+++ b/seaplayer/objects/Labels.py
@@ -1,10 +1,12 @@
-from textual.widgets import Label
-from rich.segment import Segments, Segment
+from textual.widgets import Label, Button
from rich.style import Style
+from rich.console import RenderableType
+from rich.segment import Segments, Segment
# > Typing
-from typing import Optional
+from typing import Optional, Union, Callable, Awaitable
+from inspect import iscoroutinefunction
-# ! Main Class
+# ! Fill Label Class
class FillLabel(Label):
def _gen(self) -> Segments:
return Segments([Segment(self.__chr, self.__style) for i in range((self.size[0] * self.size[1]))])
@@ -21,4 +23,42 @@ def __init__(
self.update(self._gen())
async def on_resize(self) -> None:
- self.update(self._gen())
\ No newline at end of file
+ self.update(self._gen())
+
+# ! Clickable Label Class
+class ClickableLabel(Label, Button, can_focus=True):
+ def __init__(
+ self,
+ renderable: RenderableType="",
+ callback: Union[Callable[[], None], Callable[[], Awaitable[None]]]=lambda: None,
+ *,
+ expand: bool=False,
+ shrink: bool=False,
+ markup: bool=True,
+ name: Optional[str]=None,
+ id: Optional[str]=None,
+ classes: Optional[str]=None,
+ disabled: bool=False
+ ) -> None:
+ super().__init__(
+ renderable,
+ expand=expand,
+ shrink=shrink,
+ markup=markup,
+ name=name,
+ id=id,
+ classes=classes,
+ disabled=disabled
+ )
+ self.__callback = callback
+
+ @property
+ def callback_awaitable(self) -> bool:
+ return iscoroutinefunction(self.__callback)
+
+ async def _on_click(self, event) -> None:
+ await super()._on_click(event)
+ if self.callback_awaitable:
+ await self.__callback()
+ else:
+ self.__callback()
diff --git a/seaplayer/objects/Rheostat.py b/seaplayer/objects/Rheostat.py
index b186a8f..bf8c5c7 100644
--- a/seaplayer/objects/Rheostat.py
+++ b/seaplayer/objects/Rheostat.py
@@ -4,7 +4,7 @@
# > Typing
from typing import Callable
# > Local Imports
-from .Buttons import ClikableButton
+from .Labels import ClickableLabel
# ! RheostatBar Class
class RheostatBar(Label):
@@ -114,9 +114,8 @@ def __init__(
super().__init__(
Center(self.bar),
Horizontal(
- ClikableButton("-", self.__click_minus),
+ ClickableLabel("-", self.__click_minus),
self.label,
- ClikableButton("+", self.__click_plus)
- ),
- classes="rheostat"
+ ClickableLabel("+", self.__click_plus)
+ )
)
\ No newline at end of file
diff --git a/seaplayer/objects/__init__.py b/seaplayer/objects/__init__.py
index 1a80cdd..932f03f 100644
--- a/seaplayer/objects/__init__.py
+++ b/seaplayer/objects/__init__.py
@@ -8,7 +8,7 @@
from .MusicList import MusicListView, MusicListViewItem
from .Configurate import ConfigurateListItem, ConfigurateList
from .Radio import DataRadioSet, DataRadioButton
+from .Rheostat import Rheostat
# ? In development
-#from .PopUp import PopUp
-#from .Rheostat import Rheostat
\ No newline at end of file
+#from .PopUp import PopUp
\ No newline at end of file
From 88cb2eaf543b0c14cdc15200cc1765debff2e83f Mon Sep 17 00:00:00 2001
From: Romanin <60302782+romanin-rf@users.noreply.github.com>
Date: Mon, 11 Dec 2023 12:08:59 +0200
Subject: [PATCH 2/5] Unrelease Rheostat
- Added widget: Rheostat
- More attempts to make `Confiturate` screen clearer
---
seaplayer/css/objects.tcss | 2 -
seaplayer/screens/Configurate.py | 70 ++++++++++++++++++++++++++------
2 files changed, 57 insertions(+), 15 deletions(-)
diff --git a/seaplayer/css/objects.tcss b/seaplayer/css/objects.tcss
index b2a7ac1..87aa969 100644
--- a/seaplayer/css/objects.tcss
+++ b/seaplayer/css/objects.tcss
@@ -129,7 +129,6 @@ ClickableLabel {
height: auto;
min-height: 1;
color: $text;
- background: $panel;
text-style: bold;
text-align: center;
content-align: center middle;
@@ -144,7 +143,6 @@ ClickableLabel:hover {
}
ClickableLabel.-active {
- background: $panel;
tint: $background 30%;
}
diff --git a/seaplayer/screens/Configurate.py b/seaplayer/screens/Configurate.py
index 2be9fbc..9ecaf19 100644
--- a/seaplayer/screens/Configurate.py
+++ b/seaplayer/screens/Configurate.py
@@ -15,6 +15,7 @@
from ..modules.colorizer import richefication
from ..objects import (
Nofy,
+ Rheostat,
InputField,
DataOptionList, DataOption,
DataRadioSet, DataRadioButton,
@@ -94,20 +95,23 @@ def _upfif(self, attr_name: str) -> str:
def gupfif(self, attr_name: str):
return lambda: self._upfif(attr_name)
- # ! Update App Config
+ # ! Update App Vars
+ def sattr(self, attr_name: str, value: Any) -> None:
+ exec(f"self.{attr_name}=value")
+
+ def gattr(self, attr_name: str) -> Any:
+ return eval(f"self.{attr_name}")
+
async def _auac(self, attr_name: str, input: InputField, value: str) -> None:
- exec(f"self.{attr_name} = value")
+ self.sattr(attr_name, value)
self.app.update_bindings()
await self.aio_nofy("Saved!")
def _caa(self, attr_name: str, value: str) -> None:
- exec(f"self.{attr_name} = value")
+ self.sattr(attr_name, value)
self.app.update_bindings()
self.nofy("Saved!")
- def _gaa(self, attr_name: str) -> Any:
- return eval(f"self.{attr_name}")
-
if INIT_SOUNDDEVICE:
def gucsdi(self):
async def n_ucsdi(option: DataOption) -> None:
@@ -169,7 +173,7 @@ def create_configurator_literal(
restart_required: bool=True
) -> ConfigurateListItem:
on_changed_method = lambda v: self._caa(attr_name, v)
- default_value = [v[0] if isinstance(v, tuple) else v for v in values].index(self._gaa(attr_name))
+ default_value = [v[0] if isinstance(v, tuple) else v for v in values].index(self.gattr(attr_name))
buttons = []
for idx, d in enumerate(values):
drb = \
@@ -183,6 +187,43 @@ def create_configurator_literal(
desc=desc+(f" [red]({self.ll.get('words.restart_required')})[/red]" if restart_required else ""),
height=len(values)+4
)
+
+ def create_configurator_integer(
+ self,
+ attr_name: str,
+ advance_value: int=1,
+ min_value: int=0,
+ max_value: int=100,
+ mark: str="",
+ group: str="Option",
+ title: str="",
+ desc: str="",
+ restart_required: bool=True
+ ):
+ return ConfigurateListItem(
+ Rheostat(lambda value: self.sattr(attr_name, value), self.gattr(attr_name), advance_value, min_value, max_value, mark),
+ title="[red]{"+group+"}[/red]: "+title,
+ desc=desc+(f" [red]({self.ll.get('words.restart_required')})[/red]" if restart_required else ""),
+ height=4
+ )
+
+ def create_configurator_percent(
+ self,
+ attr_name: str,
+ advance_value: int=1,
+ min_value: int=0,
+ max_value: int=100,
+ group: str="Option",
+ title: str="",
+ desc: str="",
+ restart_required: bool=True
+ ):
+ return ConfigurateListItem(
+ Rheostat(lambda value: self.sattr(attr_name, value/100), int(self.gattr(attr_name)*100), advance_value, min_value, max_value, "%"),
+ title="[red]{"+group+"}[/red]: "+title,
+ desc=desc+(f" [red]({self.ll.get('words.restart_required')})[/red]" if restart_required else ""),
+ height=4
+ )
def create_configurator_language(self) -> ConfigurateListItem:
languages = []
@@ -253,26 +294,29 @@ def compose(self) -> ComposeResult:
self.ll.get("configurate.image.resample_method"),
self.ll.get("configurate.image.resample_method.desc")
)
- yield self.create_configurator_type(
+ yield self.create_configurator_percent(
"app.config.volume_change_percent",
+ 1, 1, 10,
self.ll.get("configurate.playback"),
self.ll.get("configurate.playback.volume_change_percent"),
self.ll.get("configurate.playback.volume_change_percent.desc"),
- float, float, False
+ False
)
- yield self.create_configurator_type(
+ yield self.create_configurator_integer(
"app.config.rewind_count_seconds",
+ 1, 1, 30, " s",
self.ll.get("configurate.playback"),
self.ll.get("configurate.playback.rewind_count_seconds"),
self.ll.get("configurate.playback.rewind_count_seconds.desc"),
- int, int, False
+ False
)
- yield self.create_configurator_type(
+ yield self.create_configurator_percent(
"app.config.max_volume_percent",
+ 10, 10, 300,
self.ll.get("configurate.playback"),
self.ll.get("configurate.playback.max_volume_percent"),
self.ll.get("configurate.playback.max_volume_percent.desc"),
- float, float, False
+ False
)
yield self.create_configurator_literal(
"app.config.recursive_search",
From 482c8eca7c3cdf0e633e774cbdd6a619054059b6 Mon Sep 17 00:00:00 2001
From: Romanin <60302782+romanin-rf@users.noreply.github.com>
Date: Mon, 11 Dec 2023 17:35:55 +0200
Subject: [PATCH 3/5] Unrelease language
- Fixed all language
---
seaplayer/langs/en-eng.properties | 3 ++-
seaplayer/langs/ru-rus.properties | 3 ++-
seaplayer/langs/uk-ukr.properties | 1 +
seaplayer/objects/Image.py | 1 -
seaplayer/screens/Configurate.py | 2 +-
5 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/seaplayer/langs/en-eng.properties b/seaplayer/langs/en-eng.properties
index 839369d..6eeb86c 100644
--- a/seaplayer/langs/en-eng.properties
+++ b/seaplayer/langs/en-eng.properties
@@ -89,4 +89,5 @@ configurate.keys.volume_minus.desc="Turn down the volume."
words.on="On"
words.off="Off"
words.currect="Currect"
-words.restart_required="restart required"
\ No newline at end of file
+words.restart_required="restart required"
+words.second.char="s"
\ No newline at end of file
diff --git a/seaplayer/langs/ru-rus.properties b/seaplayer/langs/ru-rus.properties
index dd8e5b6..04c3238 100644
--- a/seaplayer/langs/ru-rus.properties
+++ b/seaplayer/langs/ru-rus.properties
@@ -89,4 +89,5 @@ configurate.keys.volume_minus.desc="Убавить громкость."
words.on="Включено"
words.off="Отключено"
words.currect="Текущий"
-words.restart_required="требуется перезагрузка"
\ No newline at end of file
+words.restart_required="требуется перезагрузка"
+words.second.char="с"
\ No newline at end of file
diff --git a/seaplayer/langs/uk-ukr.properties b/seaplayer/langs/uk-ukr.properties
index a7d1dfd..a36ac43 100644
--- a/seaplayer/langs/uk-ukr.properties
+++ b/seaplayer/langs/uk-ukr.properties
@@ -89,3 +89,4 @@ words.on="Увімкнено"
words.off="Вимкнено"
words.currect="Поточний"
words.restart_required="потрібна перезавантаження"
+words.second.char="с"
\ No newline at end of file
diff --git a/seaplayer/objects/Image.py b/seaplayer/objects/Image.py
index 899367f..d32a2d1 100644
--- a/seaplayer/objects/Image.py
+++ b/seaplayer/objects/Image.py
@@ -33,7 +33,6 @@ async def on_resize(self) -> None:
async def update_image(self, image: Optional[Image.Image]=None) -> None:
self.image = image
-
image, resample = (self.default_image, Resampling.NEAREST) if (self.image is None) else (self.image, self.image_resample)
self.image_text = await asyncio.to_thread(Pixels.from_image, image, (self.size[0], self.size[1]), resample)
self.update(self.image_text)
diff --git a/seaplayer/screens/Configurate.py b/seaplayer/screens/Configurate.py
index 9ecaf19..8f0914b 100644
--- a/seaplayer/screens/Configurate.py
+++ b/seaplayer/screens/Configurate.py
@@ -304,7 +304,7 @@ def compose(self) -> ComposeResult:
)
yield self.create_configurator_integer(
"app.config.rewind_count_seconds",
- 1, 1, 30, " s",
+ 1, 1, 30, f" {self.ll.get('words.second.char')}",
self.ll.get("configurate.playback"),
self.ll.get("configurate.playback.rewind_count_seconds"),
self.ll.get("configurate.playback.rewind_count_seconds.desc"),
From dc9b9c3794d18c65f29555800f3de652ef478212 Mon Sep 17 00:00:00 2001
From: Romanin <60302782+romanin-rf@users.noreply.github.com>
Date: Mon, 11 Dec 2023 21:15:21 +0200
Subject: [PATCH 4/5] Update 0.8.4
- Added a new widget: `PopUp`
- Moved all `CSS` from `objects.tcss` to `DEFAULT_CSS` separately for each widget
---
seaplayer/css/configurate.tcss | 4 +
seaplayer/css/objects.tcss | 148 ------------------------------
seaplayer/css/seaplayer.tcss | 2 +
seaplayer/objects/Configurate.py | 18 ++++
seaplayer/objects/DataOptions.py | 2 +
seaplayer/objects/Image.py | 18 ++++
seaplayer/objects/Labels.py | 28 ++++++
seaplayer/objects/Log.py | 23 ++++-
seaplayer/objects/MusicList.py | 20 ++++
seaplayer/objects/Notification.py | 23 +++++
seaplayer/objects/PopUp.py | 15 ++-
seaplayer/objects/ProgressBar.py | 6 ++
seaplayer/objects/Radio.py | 3 -
seaplayer/objects/Rheostat.py | 21 +++++
seaplayer/objects/__init__.py | 4 +-
secrets | 2 +-
16 files changed, 178 insertions(+), 159 deletions(-)
diff --git a/seaplayer/css/configurate.tcss b/seaplayer/css/configurate.tcss
index e69de29..d565f78 100644
--- a/seaplayer/css/configurate.tcss
+++ b/seaplayer/css/configurate.tcss
@@ -0,0 +1,4 @@
+Configurate {
+ align-vertical: middle;
+ align-horizontal: center;
+}
\ No newline at end of file
diff --git a/seaplayer/css/objects.tcss b/seaplayer/css/objects.tcss
index 87aa969..1dfb2b5 100644
--- a/seaplayer/css/objects.tcss
+++ b/seaplayer/css/objects.tcss
@@ -1,150 +1,2 @@
-/* ! Music List */
-MusicListView {
- height: 1fr;
-}
-
-MusicListViewItem {
- height: 4;
-}
-
-MusicListViewItem .title-label {
- height: 1;
- color: #cacaca;
-}
-
-MusicListViewItem .subtitle-label {
- height: 1;
- color: #a9a9a9;
-}
-
-/* ! IndeterminateProgress */
-IndeterminateProgress { height: 1; }
-
-/* ! Rheostat */
-RheostatBar { height: 1; }
-Rheostat {
- height: 2;
- align-vertical: middle;
-}
-Rheostat Horizontal {
- align-horizontal: center;
- width: 1fr;
-}
-Rheostat Horizontal ClickableLabel {
- width: 1;
- height: 1;
-}
-
-/* ! Image Label */
-StandartImageLabel {
- height: 1fr;
- width: 1fr;
- align: center middle;
- text-align: center;
-}
-
-AsyncImageLabel {
- height: 1fr;
- width: 1fr;
- align: center middle;
- text-align: center;
-}
-
-/* ! Configurate List */
-ConfigurateList {
- border: solid cadetblue;
- height: 1fr;
- width: 1fr;
-}
-
-ConfigurateListItem {
- border: solid dodgerblue;
- background: #0000;
- border-title-color: #aaaaaa;
- border-subtitle-color: #6b6b6b;
- height: auto;
-}
-
-/* ! Log Menu */
-LogMenu {
- background: $surface;
- color: $text;
- height: 50vh;
- dock: bottom;
- layer: notes;
- border-top: hkey $primary;
- offset-y: 0;
- transition: offset 400ms in_out_cubic;
- padding: 0 1 1 1;
-}
-
-LogMenu:focus {
- offset: 0 0 !important;
-}
-
-LogMenu.--hidden {
- offset-y: 100%;
-}
-
-/* ! Nofy */
-Nofy {
- layer: nofys;
- background: $background;
- margin: 2 4;
- padding: 1 2;
- width: auto;
- height: auto;
-}
-
-CallNofy {
- layer: nofys;
- background: $background;
- margin: 2 4;
- padding: 1 2;
- width: auto;
- height: auto;
-}
-
-/* ! PopUp */
-PopUp {
- layer: popups;
- background: $background;
- align: center middle;
- content-align: center middle;
- width: auto;
- height: auto;
- padding: 1 2 1 2;
-}
-
-/* ! FullLabel */
-FillLabel {
- height: 1fr;
- width: 1fr;
-}
-
-/* Clickable Label */
-ClickableLabel {
- width: auto;
- min-width: 1;
- height: auto;
- min-height: 1;
- color: $text;
- text-style: bold;
- text-align: center;
- content-align: center middle;
-}
-
-ClickableLabel:focus {
- text-style: bold reverse;
-}
-
-ClickableLabel:hover {
- color: $text;
-}
-
-ClickableLabel.-active {
- tint: $background 30%;
-}
-
/* ! Any Elements CSS */
.pass-one-width { width: 1; }
\ No newline at end of file
diff --git a/seaplayer/css/seaplayer.tcss b/seaplayer/css/seaplayer.tcss
index 035f849..8850d80 100644
--- a/seaplayer/css/seaplayer.tcss
+++ b/seaplayer/css/seaplayer.tcss
@@ -1,6 +1,8 @@
/* ! Main Screen */
#_default {
layout: horizontal;
+ align-horizontal: center;
+ align-vertical: middle;
}
.screen-box {
diff --git a/seaplayer/objects/Configurate.py b/seaplayer/objects/Configurate.py
index d4a888b..45c5dde 100644
--- a/seaplayer/objects/Configurate.py
+++ b/seaplayer/objects/Configurate.py
@@ -4,6 +4,16 @@
# ! Child Class
class ConfigurateListItem(Container):
+ DEFAULT_CSS = """
+ ConfigurateListItem {
+ border: solid dodgerblue;
+ background: #0000;
+ border-title-color: #aaaaaa;
+ border-subtitle-color: #6b6b6b;
+ height: auto;
+ }
+ """
+
def __init__(
self,
*children,
@@ -25,5 +35,13 @@ async def updating(self, title: Optional[str]="", desc: Optional[str]="") -> Non
# ! Main Class
class ConfigurateList(ScrollableContainer):
+ DEFAULT_CSS = """
+ ConfigurateList {
+ border: solid cadetblue;
+ height: 1fr;
+ width: 1fr;
+ }
+ """
+
def __init__(self, *children, **kwargs) -> None:
super().__init__(*children, **kwargs)
diff --git a/seaplayer/objects/DataOptions.py b/seaplayer/objects/DataOptions.py
index 0907e9a..5329d2e 100644
--- a/seaplayer/objects/DataOptions.py
+++ b/seaplayer/objects/DataOptions.py
@@ -3,6 +3,7 @@
# > Typing
from typing import Optional, Callable
+# ! Child Class
class DataOption(Option):
def __init__(
self,
@@ -17,6 +18,7 @@ def __init__(
self.selected = selected
self.data = data
+# ! Main Class
class DataOptionList(OptionList):
def __init__(
self,
diff --git a/seaplayer/objects/Image.py b/seaplayer/objects/Image.py
index d32a2d1..80a2112 100644
--- a/seaplayer/objects/Image.py
+++ b/seaplayer/objects/Image.py
@@ -9,6 +9,15 @@
# ! Main Class
class StandartImageLabel(Label):
+ DEFAULT_CSS = """
+ StandartImageLabel {
+ height: 1fr;
+ width: 1fr;
+ align: center middle;
+ text-align: center;
+ }
+ """
+
def __init__(
self,
default_image: Image.Image,
@@ -38,6 +47,15 @@ async def update_image(self, image: Optional[Image.Image]=None) -> None:
self.update(self.image_text)
class AsyncImageLabel(Label):
+ DEFAULT_CSS = """
+ AsyncImageLabel {
+ height: 1fr;
+ width: 1fr;
+ align: center middle;
+ text-align: center;
+ }
+ """
+
def __init__(
self,
default_image: Image.Image,
diff --git a/seaplayer/objects/Labels.py b/seaplayer/objects/Labels.py
index 2a292f5..8c5da95 100644
--- a/seaplayer/objects/Labels.py
+++ b/seaplayer/objects/Labels.py
@@ -8,6 +8,13 @@
# ! Fill Label Class
class FillLabel(Label):
+ DEFAULT_CSS = """
+ FillLabel {
+ height: 1fr;
+ width: 1fr;
+ }
+ """
+
def _gen(self) -> Segments:
return Segments([Segment(self.__chr, self.__style) for i in range((self.size[0] * self.size[1]))])
@@ -27,6 +34,27 @@ async def on_resize(self) -> None:
# ! Clickable Label Class
class ClickableLabel(Label, Button, can_focus=True):
+ DEFAULT_CSS = """
+ ClickableLabel {
+ width: auto;
+ min-width: 1;
+ height: auto;
+ min-height: 1;
+ color: $text;
+ text-style: bold;
+ text-align: center;
+ content-align: center middle;
+ }
+ ClickableLabel:focus {
+ text-style: bold reverse;
+ }
+ ClickableLabel:hover {
+ color: $text;
+ }
+ ClickableLabel.-active {
+ tint: $background 30%;
+ }
+ """
def __init__(
self,
renderable: RenderableType="",
diff --git a/seaplayer/objects/Log.py b/seaplayer/objects/Log.py
index e89fec9..1af321c 100644
--- a/seaplayer/objects/Log.py
+++ b/seaplayer/objects/Log.py
@@ -8,11 +8,28 @@
# ! Vars
console = Console()
-# ! Types
-RETURN = TypeVar('RETURN')
-
# ! Main Class
class LogMenu(RichLog):
+ DEFAULT_CSS = """
+ LogMenu {
+ background: $surface;
+ color: $text;
+ height: 75vh;
+ dock: bottom;
+ layer: notes;
+ border-top: hkey $primary;
+ offset-y: 0;
+ transition: offset 400ms in_out_cubic;
+ padding: 0 1 1 1;
+ }
+ LogMenu:focus {
+ offset: 0 0 !important;
+ }
+ LogMenu.--hidden {
+ offset-y: 100%;
+ }
+ """
+
def __init__(self, chap_max_width: int=8, enable_logging: bool=True, **kwargs):
self.enable_logging = enable_logging
self.chap_max_width = chap_max_width
diff --git a/seaplayer/objects/MusicList.py b/seaplayer/objects/MusicList.py
index 37d50c5..72e5429 100644
--- a/seaplayer/objects/MusicList.py
+++ b/seaplayer/objects/MusicList.py
@@ -9,6 +9,20 @@
# ! Children Classes
class MusicListViewItem(ListItem):
+ DEFAULT_CSS = """
+ MusicListViewItem {
+ height: 4;
+ }
+ MusicListViewItem .title-label {
+ height: 1;
+ color: #cacaca;
+ }
+ MusicListViewItem .subtitle-label {
+ height: 1;
+ color: #a9a9a9;
+ }
+ """
+
def __init__(
self,
title: str="",
@@ -39,6 +53,12 @@ async def update_labels(
# ! Main Class
class MusicListView(ListView):
+ DEFAULT_CSS = """
+ MusicListView {
+ height: 1fr;
+ }
+ """
+
def __init__(self, *args, **kwargs) -> None:
super().__init__(*args, **kwargs)
self.music_list: MusicList = MusicList()
diff --git a/seaplayer/objects/Notification.py b/seaplayer/objects/Notification.py
index 6a6114d..4a7d768 100644
--- a/seaplayer/objects/Notification.py
+++ b/seaplayer/objects/Notification.py
@@ -4,6 +4,17 @@
# ! Nofys Classes
class Nofy(Static):
+ DEFAULT_CSS = """
+ Nofy {
+ layer: nofys;
+ background: $background;
+ margin: 2 4;
+ padding: 1 2;
+ width: auto;
+ height: auto;
+ }
+ """
+
def __init__(
self,
text: str,
@@ -21,7 +32,19 @@ def on_mount(self) -> None:
async def on_click(self) -> None:
await self.remove()
+# ! Variant Nofy
class CallNofy(Static):
+ DEFAULT_CSS = """
+ CallNofy {
+ layer: nofys;
+ background: $background;
+ margin: 2 4;
+ padding: 1 2;
+ width: auto;
+ height: auto;
+ }
+ """
+
def __init__(
self,
text: str,
diff --git a/seaplayer/objects/PopUp.py b/seaplayer/objects/PopUp.py
index be5d067..e25b05e 100644
--- a/seaplayer/objects/PopUp.py
+++ b/seaplayer/objects/PopUp.py
@@ -1,5 +1,18 @@
from textual.containers import Container
-# ! Classes
+# ! Main Class
class PopUp(Container):
+ DEFAULT_CSS = """
+ PopUp {
+ layer: popup;
+ background: $background;
+ align-vertical: middle;
+ align-horizontal: center;
+ content-align: center middle;
+ width: auto;
+ height: auto;
+ padding: 1 2 1 2;
+ }
+ """
+
pass
diff --git a/seaplayer/objects/ProgressBar.py b/seaplayer/objects/ProgressBar.py
index 5b99847..bff3cf4 100644
--- a/seaplayer/objects/ProgressBar.py
+++ b/seaplayer/objects/ProgressBar.py
@@ -7,6 +7,12 @@
# ! Main Class
class IndeterminateProgress(Static):
+ DEFAULT_CSS = """
+ IndeterminateProgress {
+ height: 1;
+ }
+ """
+
def __init__(
self,
getfunc: Callable[[], Coroutine[Any, Any, Tuple[str, Optional[float], Optional[float]]]]=get_bar_status,
diff --git a/seaplayer/objects/Radio.py b/seaplayer/objects/Radio.py
index 6993eef..ae8ba61 100644
--- a/seaplayer/objects/Radio.py
+++ b/seaplayer/objects/Radio.py
@@ -14,9 +14,6 @@ def __init__(self, data: DT, value: bool=False, visible_data: Optional[str]=None
# ! Data Radio Set Class
class DataRadioSet(RadioSet, Generic[DT]):
- pressed_index: int
- pressed_button: Optional[DataRadioButton[DT]]
-
def __init__(
self,
on_changed: Callable[[DT], None],
diff --git a/seaplayer/objects/Rheostat.py b/seaplayer/objects/Rheostat.py
index bf8c5c7..3ae809a 100644
--- a/seaplayer/objects/Rheostat.py
+++ b/seaplayer/objects/Rheostat.py
@@ -8,6 +8,12 @@
# ! RheostatBar Class
class RheostatBar(Label):
+ DEFAULT_CSS = """
+ RheostatBar {
+ height: 1;
+ }
+ """
+
def __match_bar_width(self) -> int:
bar_size = self.size[0] - (len(f"{self.__min_value}{self.__max_value}")+(len(self.__mark)*2)+2)
if bar_size <= 0:
@@ -86,6 +92,21 @@ async def on_resize(self) -> None:
self.update(self.__process)
class Rheostat(Vertical):
+ DEFAULT_CSS = """
+ Rheostat {
+ height: 2;
+ align-vertical: middle;
+ }
+ Rheostat Horizontal {
+ align-horizontal: center;
+ width: 1fr;
+ }
+ Rheostat Horizontal ClickableLabel {
+ width: 1;
+ height: 1;
+ }
+ """
+
async def __click_plus(self) -> None:
if (self.bar.value + self.__advance_value) <= self.bar.max_value:
self.bar.value = self.bar.value + self.__advance_value
diff --git a/seaplayer/objects/__init__.py b/seaplayer/objects/__init__.py
index 932f03f..14ebba6 100644
--- a/seaplayer/objects/__init__.py
+++ b/seaplayer/objects/__init__.py
@@ -9,6 +9,4 @@
from .Configurate import ConfigurateListItem, ConfigurateList
from .Radio import DataRadioSet, DataRadioButton
from .Rheostat import Rheostat
-
-# ? In development
-#from .PopUp import PopUp
\ No newline at end of file
+from .PopUp import PopUp
diff --git a/secrets b/secrets
index da3b8c9..e912069 160000
--- a/secrets
+++ b/secrets
@@ -1 +1 @@
-Subproject commit da3b8c972899090d0f6f069c0cd8bc68f3378c9b
+Subproject commit e9120692abdb61d40cc105130644c109b7a0dc9c
From f7f29c63c4cad1ed308419b2f99424dc60ec7297 Mon Sep 17 00:00:00 2001
From: Romanin <60302782+romanin-rf@users.noreply.github.com>
Date: Mon, 11 Dec 2023 21:18:49 +0200
Subject: [PATCH 5/5] Update changelog.md
---
changelog.md | 1 +
pyproject.toml | 2 +-
seaplayer/units.py | 2 +-
3 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/changelog.md b/changelog.md
index 1dbd85c..ee3d317 100644
--- a/changelog.md
+++ b/changelog.md
@@ -3,6 +3,7 @@
| Version | Date | Tag | Changelog |
| ------- | ---- | --- | --------- |
+| [v0.8.4](https://github.com/romanin-rf/SeaPlayer/releases/tag/v0.8.4) | 11.12.2023 | **STABLE** | - Added widgets: `Rheostat`, `ClickableLabel`
- Added widget: Rheostat
- Added a new widget: `PopUp`
- Fixed all language
- More attempts to make `Confiturate` screen clearer
- Moved all `CSS` from `objects.tcss` to `DEFAULT_CSS` separately for each widget |
| [v0.8.3](https://github.com/romanin-rf/SeaPlayer/releases/tag/v0.8.3) | 10.12.2023 | **STABLE** | - Added plugin `VKMusic`
- Added priority system for codecs
- Added system handhers of value
- Fixed `build.py`
- Moved method `load_plugin_info` in `seaplayer.plug.pluginloader` |
| [v0.8.2](https://github.com/romanin-rf/SeaPlayer/releases/tag/v0.8.2) | 08.12.2023 | **STABLE** | - Added language merge (for translating plugins)
- Fixed in translation files (`Log Menu Enable` -> `Logging` )
- Changed `object.css` (classes will no longer be used to specify standard properties)
- Improved widget `FillLabel` |
| [v0.8.1](https://github.com/romanin-rf/SeaPlayer/releases/tag/v0.8.1) | 07.12.2023 | **STABLE** | - Revisioned of the LanguageLoader
- Added new language: `Українська` |
diff --git a/pyproject.toml b/pyproject.toml
index 290df4c..e081674 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[tool.poetry]
name = "SeaPlayer"
-version = "0.8.3"
+version = "0.8.4"
description = "SeaPlayer is a player that works in the terminal."
repository = "https://github.com/romanin-rf/SeaPlayer"
authors = ["Romanin "]
diff --git a/seaplayer/units.py b/seaplayer/units.py
index ae5da2a..7639e82 100644
--- a/seaplayer/units.py
+++ b/seaplayer/units.py
@@ -6,7 +6,7 @@
# ! Metadata
__title__ = "SeaPlayer"
-__version__ = "0.8.3"
+__version__ = "0.8.4"
__author__ = "Romanin"
__email__ = "semina054@gmail.com"
__url__ = "https://github.com/romanin-rf/SeaPlayer"