33from itertools import product
44from typing import TYPE_CHECKING , cast
55
6- from fonticon_mdi6 import MDI6
6+ from pyconify import svg_path
77from pymmcore_plus import CMMCorePlus , DeviceType , Keyword
8- from qtpy .QtCore import QEvent , QObject , Qt , QTimerEvent , Signal
8+ from qtpy .QtCore import QEvent , QObject , QSize , Qt , QTimerEvent , Signal
99from qtpy .QtGui import QContextMenuEvent
1010from qtpy .QtWidgets import (
1111 QCheckBox ,
2020 QVBoxLayout ,
2121 QWidget ,
2222)
23- from superqt .fonticon import icon , setTextIcon
23+ from superqt .iconify import QIconifyIcon
2424from superqt .utils import signals_blocked
2525
2626from ._q_stage_controller import QStageMoveAccumulator
3434
3535MOVE_BUTTONS : dict [str , tuple [int , int , int , int ]] = {
3636 # btn glyph (r, c, xmag, ymag)
37- MDI6 . chevron_triple_up : (0 , 3 , 0 , 3 ),
38- MDI6 . chevron_double_up : (1 , 3 , 0 , 2 ),
39- MDI6 . chevron_up : (2 , 3 , 0 , 1 ),
40- MDI6 . chevron_down : (4 , 3 , 0 , - 1 ),
41- MDI6 . chevron_double_down : (5 , 3 , 0 , - 2 ),
42- MDI6 . chevron_triple_down : (6 , 3 , 0 , - 3 ),
43- MDI6 . chevron_triple_left : (3 , 0 , - 3 , 0 ),
44- MDI6 . chevron_double_left : (3 , 1 , - 2 , 0 ),
45- MDI6 . chevron_left : (3 , 2 , - 1 , 0 ),
46- MDI6 . chevron_right : (3 , 4 , 1 , 0 ),
47- MDI6 . chevron_double_right : (3 , 5 , 2 , 0 ),
48- MDI6 . chevron_triple_right : (3 , 6 , 3 , 0 ),
37+ "mdi:chevron-triple-up" : (0 , 3 , 0 , 3 ),
38+ "mdi:chevron-double-up" : (1 , 3 , 0 , 2 ),
39+ "mdi:chevron-up" : (2 , 3 , 0 , 1 ),
40+ "mdi:chevron-down" : (4 , 3 , 0 , - 1 ),
41+ "mdi:chevron-double-down" : (5 , 3 , 0 , - 2 ),
42+ "mdi:chevron-triple-down" : (6 , 3 , 0 , - 3 ),
43+ "mdi:chevron-triple-left" : (3 , 0 , - 3 , 0 ),
44+ "mdi:chevron-double-left" : (3 , 1 , - 2 , 0 ),
45+ "mdi:chevron-left" : (3 , 2 , - 1 , 0 ),
46+ "mdi:chevron-right" : (3 , 4 , 1 , 0 ),
47+ "mdi:chevron-double-right" : (3 , 5 , 2 , 0 ),
48+ "mdi:chevron-triple-right" : (3 , 6 , 3 , 0 ),
4949}
5050
5151
@@ -58,21 +58,20 @@ def __init__(self, glyph: str, xmag: int, ymag: int, parent: QWidget | None = No
5858 self .setFlat (True )
5959 self .setFocusPolicy (Qt .FocusPolicy .NoFocus )
6060 self .setCursor (Qt .CursorShape .PointingHandCursor )
61- setTextIcon (self , glyph )
6261 self .setStyleSheet (
63- """
64- MoveStageButton {
62+ f """
63+ MoveStageButton {{
6564 border: none;
6665 background: transparent;
67- color: rgb(0, 180, 0);
66+ image: url( { svg_path ( glyph , color = " rgb(0, 180, 0)" ) } );
6867 font-size: 36px;
69- }
70- MoveStageButton:hover:!pressed {
71- color: rgb(0, 255, 0 );
72- }
73- MoveStageButton:pressed {
74- color: rgb(0, 100, 0 );
75- }
68+ }}
69+ MoveStageButton:hover:!pressed {{
70+ image: url( { svg_path ( glyph , color = "lime" ) } );
71+ }}
72+ MoveStageButton:pressed {{
73+ image: url( { svg_path ( glyph , color = "green" ) } );
74+ }}
7675 """
7776 )
7877
@@ -107,7 +106,8 @@ def __init__(self, device: str, core: CMMCorePlus, parent: QWidget | None = None
107106 super ().__init__ (parent = parent )
108107 self ._device = device
109108 self ._core = core
110- self .setIcon (icon (MDI6 .close_octagon , color = (255 , 0 , 0 )))
109+ self .setIcon (QIconifyIcon ("bi:sign-stop-fill" , color = "red" ))
110+ self .setIconSize (QSize (24 , 24 ))
111111 self .setToolTip ("Halt stage movement" )
112112 self .setText ("STOP!" )
113113 self .clicked .connect (self ._on_clicked )
0 commit comments