Skip to content

Commit 5280bdc

Browse files
committed
Adaptive Overview, Better Bluetooth UI, deleted tabler-icons from installer.
1 parent da99ce5 commit 5280bdc

10 files changed

+60
-22
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
<table align="center">
2121
<tr>
22-
<td align="center"><sup> sᴜᴘᴘᴏʀᴛ ᴛʜᴇ ᴘʀᴏᴊᴇᴄᴛ </sup></td>
22+
<td align="center"><img src="https://raw.githubusercontent.com/Tarikul-Islam-Anik/Telegram-Animated-Emojis/main/Activity/Sparkles.webp" alt="Sparkles" width="16" height="16" /><sup> sᴜᴘᴘᴏʀᴛ ᴛʜᴇ ᴘʀᴏᴊᴇᴄᴛ </sup><img src="https://raw.githubusercontent.com/Tarikul-Islam-Anik/Telegram-Animated-Emojis/main/Activity/Sparkles.webp" alt="Sparkles" width="16" height="16" /></td>
2323
</tr>
2424
<tr>
2525
<td align="center">

install.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ PACKAGES=(
2222
python-toml
2323
python-watchdog
2424
swww
25-
ttf-tabler-icons
2625
uwsm
2726
vte3
2827
)

main.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@
77
from modules.corners import Corners
88
from config.config import open_config
99

10+
import gi
11+
gi.require_version("Gtk", "3.0")
12+
from gi.repository import Gdk
13+
14+
screen = Gdk.Screen.get_default()
15+
CURRENT_WIDTH = screen.get_width()
16+
CURRENT_HEIGHT = screen.get_height()
17+
1018
config_path = os.path.expanduser("~/.config/Ax-Shell/config/config.json")
1119

1220
if __name__ == "__main__":
@@ -18,6 +26,12 @@
1826
notch = Notch()
1927
bar.notch = notch
2028
app = Application("ax-shell", bar, notch)
21-
app.set_stylesheet_from_file(get_relative_path("main.css"))
29+
app.set_stylesheet_from_file(
30+
get_relative_path("main.css"),
31+
exposed_functions={
32+
"overview_width": lambda: f"min-width: {CURRENT_WIDTH * 0.1 * 5}px;",
33+
"overview_height": lambda: f"min-height: {CURRENT_HEIGHT * 0.1 * 2}px;",
34+
},
35+
)
2236

2337
app.run()

modules/bluetooth.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,11 @@ def __init__(self, **kwargs):
8282
self.available_box = Box(spacing=2, orientation="vertical")
8383

8484
self.children = [
85-
CenterBox(start_children=self.scan_button, center_children=Label(name="bluetooth-text", label="Bluetooth Devices"), end_children=self.toggle_button),
86-
Label(name="bluetooth-text", label="Paired"),
87-
ScrolledWindow(min_content_size=(-1, -1), child=self.paired_box),
88-
Label(name="bluetooth-text", label="Available"),
89-
ScrolledWindow(min_content_size=(-1, -1), child=self.available_box),
85+
CenterBox(name="bluetooth-header", start_children=self.scan_button, center_children=Label(name="bluetooth-text", label="Bluetooth Devices"), end_children=self.toggle_button),
86+
Label(name="bluetooth-section", label="Paired"),
87+
ScrolledWindow(name="bluetooth-paired", min_content_size=(590, 160), child=self.paired_box, v_expand=True),
88+
Label(name="bluetooth-section", label="Available"),
89+
ScrolledWindow(name="bluetooth-available", min_content_size=(590, 160), child=self.available_box, v_expand=True),
9090
]
9191

9292
# to run notify closures thus display the status

modules/notch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def __init__(self, **kwargs):
6262
v_expand=True,
6363
h_expand=True,
6464
transition_type="crossfade",
65-
transition_duration=250,
65+
transition_duration=100,
6666
children=[
6767
self.compact,
6868
self.launcher,

modules/notifications.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,8 @@ def destroy(self):
205205
self.stop_timeout()
206206
super().destroy()
207207

208-
@staticmethod
209-
def set_pointer_cursor(widget, cursor_name):
208+
# @staticmethod
209+
def set_pointer_cursor(self, widget, cursor_name):
210210
"""Cambia el cursor sobre un widget."""
211211
window = widget.get_window()
212212
if window:
@@ -228,6 +228,13 @@ def __init__(self, **kwargs):
228228
self._server = Notifications()
229229
self._server.connect("notification-added", self.on_new_notification)
230230

231+
def set_pointer_cursor(self, widget, cursor_name):
232+
"""Cambia el cursor sobre un widget."""
233+
window = widget.get_window()
234+
if window:
235+
cursor = Gdk.Cursor.new_from_name(widget.get_display(), cursor_name)
236+
window.set_cursor(cursor)
237+
231238
def on_new_notification(self, fabric_notif, id):
232239
for child in self.get_children():
233240
child.destroy()

modules/overview.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def __init__(self, workspace_id: int, fixed: Gtk.Fixed | None = None):
154154
class Overview(Box):
155155
def __init__(self, **kwargs):
156156
# Initialize as a Box instead of a PopupWindow.
157-
super().__init__(name="overview", orientation="v", spacing=0)
157+
super().__init__(name="overview", orientation="v")
158158
self.workspace_boxes: dict[int, Box] = {}
159159
self.clients: dict[str, HyprlandWindowButton] = {}
160160

styles/bluetooth.css

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
1-
#bluetooth-device {
1+
#bluetooth-header {
22
background-color: var(--surface);
3+
padding: 4px;
4+
border-radius: 20px;
5+
}
6+
7+
#bluetooth-device {
8+
background-color: var(--shadow);
39
border-radius: 16px;
410
padding: 4px;
511
margin-bottom: 4px;
612
}
713

814
#bluetooth-scan,
915
#bluetooth-toggle {
10-
background-color: var(--surface);
16+
background-color: var(--shadow);
1117
border-radius: 16px;
1218
padding: 8px 16px;
1319
min-width: 96px;
@@ -23,8 +29,12 @@
2329
font-weight: bold;
2430
}
2531

26-
#bluetooth-text {
32+
#bluetooth-text,
33+
#bluetooth-section {
2734
font-weight: bold;
35+
}
36+
37+
#bluetooth-text {
2838
color: var(--primary);
2939
}
3040

@@ -33,11 +43,18 @@
3343
}
3444

3545
#bluetooth-connect {
36-
background-color: var(--shadow);
37-
border-radius: 16px;
46+
background-color: var(--surface);
47+
border-radius: 12px;
3848
padding: 8px 16px;
3949
}
4050

4151
#bluetooth-connect:hover {
4252
background-color: var(--surface-bright);
4353
}
54+
55+
#bluetooth-paired,
56+
#bluetooth-available {
57+
background-color: var(--surface);
58+
border-radius: 20px;
59+
padding: 4px;
60+
}

styles/notch.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@
5151

5252
#notch-content.overview {
5353
padding: 16px;
54-
min-height: 224px;
55-
min-width: 980px;
54+
@apply overview_width();
55+
@apply overview_height();
5656
border-radius: 0 0 36px 36px;
5757
}
5858

@@ -65,8 +65,8 @@
6565

6666
#notch-content.bluetooth {
6767
padding: 16px;
68-
min-height: 300px;
69-
min-width: 500px;
68+
min-height: 464px;
69+
min-width: 604px;
7070
border-radius: 0 0 36px 36px;
7171
}
7272

styles/overview.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@
3838
}
3939

4040
#overview-workspace-box {
41-
padding: 2px;
41+
/*padding: 2px;*/
42+
/*background-color: var(--primary);*/
4243
}
4344

4445
#overview-add-label {

0 commit comments

Comments
 (0)