Skip to content

Commit 7603d88

Browse files
committed
ab_click
1 parent acd55b1 commit 7603d88

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

src/tauon/t_modules/t_main.py

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -912,6 +912,7 @@ class Input:
912912

913913
def __init__(self, gui: GuiVar) -> None:
914914
self.gui = gui
915+
self.ab_click: bool = False
915916
self.mouse_click: bool = False
916917
self.middle_click: bool = False
917918
self.right_click: bool = False
@@ -25653,7 +25654,7 @@ def koel_get_album_thread() -> None:
2565325654
shoot_dl.start()
2565425655

2565525656
def do_exit_button() -> None:
25656-
if inp.mouse_up or ab_click:
25657+
if inp.mouse_up or inp.ab_click:
2565725658
if gui.tray_active and prefs.min_to_tray:
2565825659
if inp.key_shift_down:
2565925660
tauon.exit("User clicked X button with shift key")
@@ -25775,7 +25776,7 @@ def draw_window_tools(tauon: Tauon) -> None:
2577525776
colour = (86, 85, 86, 255)
2577625777
mac_circle.render(xx + 6 * gui.scale, y, colour)
2577725778
if tauon.coll(rect) and not gui.mouse_unknown:
25778-
if (inp.mouse_up or ab_click) and coll_point(inp.last_click_location, rect):
25779+
if (inp.mouse_up or inp.ab_click) and coll_point(inp.last_click_location, rect):
2577925780
restore_full_mode()
2578025781
gui.update += 2
2578125782

@@ -25795,7 +25796,7 @@ def draw_window_tools(tauon: Tauon) -> None:
2579525796
colour = (86, 85, 86, 255)
2579625797
mac_circle.render(xx + 6 * gui.scale, y, colour)
2579725798
if tauon.coll(rect) and not gui.mouse_unknown:
25798-
if (inp.mouse_up or ab_click) and coll_point(inp.last_click_location, rect):
25799+
if (inp.mouse_up or inp.ab_click) and coll_point(inp.last_click_location, rect):
2579925800
do_minimize_button()
2580025801

2580125802
else:
@@ -25810,7 +25811,7 @@ def draw_window_tools(tauon: Tauon) -> None:
2581025811
if tauon.coll(rect):
2581125812
ddt.rect_a((rect[0], rect[1]), (rect[2], rect[3]), bg_on)
2581225813
tauon.top_panel.maximize_button.render(rect[0] + 10 * gui.scale, rect[1] + 10 * gui.scale, fg_on)
25813-
if (inp.mouse_up or ab_click) and coll_point(inp.last_click_location, rect):
25814+
if (inp.mouse_up or inp.ab_click) and coll_point(inp.last_click_location, rect):
2581425815
do_maximize_button()
2581525816
else:
2581625817
tauon.top_panel.maximize_button.render(rect[0] + 10 * gui.scale, rect[1] + 10 * gui.scale, fg_off)
@@ -25834,7 +25835,7 @@ def draw_window_tools(tauon: Tauon) -> None:
2583425835
colour = (86, 85, 86, 255)
2583525836
mac_circle.render(xx + 6 * gui.scale, y, colour)
2583625837
if tauon.coll(rect) and not gui.mouse_unknown:
25837-
if (inp.mouse_up or ab_click) and coll_point(inp.last_click_location, rect):
25838+
if (inp.mouse_up or inp.ab_click) and coll_point(inp.last_click_location, rect):
2583825839
do_maximize_button()
2583925840
else:
2584025841
if r:
@@ -25849,16 +25850,14 @@ def draw_window_tools(tauon: Tauon) -> None:
2584925850
if tauon.coll(rect):
2585025851
ddt.rect_a((rect[0], rect[1]), (rect[2], rect[3]), bg_on)
2585125852
ddt.rect_a((rect[0] + 11 * gui.scale, rect[1] + 16 * gui.scale), (14 * gui.scale, 3 * gui.scale), fg_on)
25852-
if (inp.mouse_up or ab_click) and coll_point(inp.last_click_location, rect):
25853+
if (inp.mouse_up or inp.ab_click) and coll_point(inp.last_click_location, rect):
2585325854
do_minimize_button()
2585425855
else:
2585525856
ddt.rect_a(
2585625857
(rect[0] + 11 * gui.scale, rect[1] + 16 * gui.scale), (14 * gui.scale, 3 * gui.scale), fg_off)
2585725858

2585825859
# restore
25859-
2586025860
if gui.mode == 3:
25861-
2586225861
# bg_off = [0, 0, 0, 50]
2586325862
# bg_on = [255, 255, 255, 10]
2586425863
# fg_off =(255, 255, 255, 40)
@@ -25877,7 +25876,7 @@ def draw_window_tools(tauon: Tauon) -> None:
2587725876
if tauon.coll(rect):
2587825877
ddt.rect_a((rect[0], rect[1]), (rect[2], rect[3]), bg_on)
2587925878
tauon.top_panel.restore_button.render(rect[0] + 8 * gui.scale, rect[1] + 9 * gui.scale, fg_on)
25880-
if (inp.mouse_click or ab_click) and coll_point(inp.click_location, rect):
25879+
if (inp.mouse_click or inp.ab_click) and coll_point(inp.click_location, rect):
2588125880
restore_full_mode()
2588225881
gui.update += 2
2588325882
else:
@@ -41702,7 +41701,6 @@ def dev_mode_disable_save_state() -> None:
4170241701

4170341702
gui.playlist_view_length = int(((window_size[1] - gui.playlist_top) / 16) - 1)
4170441703

41705-
ab_click = False
4170641704
d_border = 1
4170741705

4170841706
update_layout = True
@@ -42849,7 +42847,7 @@ def dev_mode_disable_save_state() -> None:
4284942847
restore_full_mode()
4285042848
gui.update += 1
4285142849

42852-
ab_click = False
42850+
inp.ab_click = False
4285342851

4285442852
if keymaps.test("new-playlist"):
4285542853
new_playlist()
@@ -42881,7 +42879,7 @@ def dev_mode_disable_save_state() -> None:
4288142879
if instance.active:
4288242880
instance.click()
4288342881
inp.mouse_click = False
42884-
ab_click = True
42882+
inp.ab_click = True
4288542883
if tauon.view_box.active:
4288642884
tauon.view_box.clicked = True
4288742885

0 commit comments

Comments
 (0)