4343
4444from core .config import HOME_CONFIGURATION_DIR
4545from core .event_service import EventService
46- from core .utils .utilities import add_shadow , build_widget_label
46+ from core .utils .utilities import add_shadow , build_widget_label , refresh_widget_style
4747from core .utils .widgets .animation_manager import AnimationManager
4848from core .utils .widgets .launchpad .app_loader import AppListLoader , ShortcutResolver
4949from core .utils .widgets .launchpad .icon_extractor import IconExtractorUtil , UrlExtractorUtil
@@ -220,15 +220,17 @@ def __init__(self, parent=None, app_data=None, icons_dir=None):
220220 button_layout = QHBoxLayout (button_container )
221221 button_layout .setContentsMargins (0 , 0 , 0 , 0 )
222222
223- cancel_btn = QPushButton ("Cancel" )
224- cancel_btn .setProperty ("class" , "button" )
225- cancel_btn .clicked .connect (self .reject )
226- button_layout .addWidget (cancel_btn )
227-
228- add_btn = QPushButton ("Save" if self .is_edit_mode else "Add" )
229- add_btn .setProperty ("class" , f"button { 'save' if self .is_edit_mode else 'add' } " )
230- add_btn .clicked .connect (self .accept )
231- button_layout .addWidget (add_btn )
223+ self .cancel_btn = QPushButton ("Cancel" )
224+ self .cancel_btn .setCursor (QCursor (Qt .CursorShape .PointingHandCursor ))
225+ self .cancel_btn .setProperty ("class" , "button" )
226+ self .cancel_btn .clicked .connect (self .reject )
227+ button_layout .addWidget (self .cancel_btn )
228+
229+ self .add_btn = QPushButton ("Save" if self .is_edit_mode else "Add" )
230+ self .add_btn .setProperty ("class" , f"button { 'save' if self .is_edit_mode else 'add' } " )
231+ self .add_btn .setCursor (QCursor (Qt .CursorShape .PointingHandCursor ))
232+ self .add_btn .clicked .connect (self .accept )
233+ button_layout .addWidget (self .add_btn )
232234 layout .addWidget (button_container )
233235 self .setLayout (layout )
234236
@@ -450,6 +452,11 @@ def accept(self):
450452
451453 super ().accept ()
452454
455+ def done (self , result ):
456+ for btn in (self .add_btn , self .cancel_btn ):
457+ btn .unsetCursor ()
458+ super ().done (result )
459+
453460
454461class SmoothScrollArea (QScrollArea ):
455462 """Custom scroll area with smooth scrolling capabilities"""
@@ -756,15 +763,15 @@ def dragLeaveEvent(event):
756763 self ._hide_drop_overlay ()
757764 app_icon ._drop_highlight = False
758765 app_icon .setProperty ("isDropTarget" , False )
759- app_icon . setStyleSheet ( "" )
766+ refresh_widget_style ( app_icon )
760767 app_icon .update ()
761768
762769 app_icon .dragLeaveEvent = dragLeaveEvent
763770
764771 def dropEvent (event ):
765772 app_icon ._drop_highlight = False
766773 app_icon .setProperty ("isDropTarget" , False )
767- app_icon . setStyleSheet ( "" )
774+ refresh_widget_style ( app_icon )
768775 app_icon .update ()
769776 source_id = event .mimeData ().text ()
770777 target_id = str (app_icon .app_data .get ("id" , "" ))
@@ -787,15 +794,15 @@ def _load_app_icon(self, app_icon):
787794 cache_key = f"{ icon_path } _{ self ._app_icon_size } _{ self ._dpr } "
788795 if cache_key in _ICON_CACHE :
789796 app_icon .icon_label .setPixmap (_ICON_CACHE [cache_key ])
790- app_icon .icon_label . setStyleSheet ( "" )
797+ refresh_widget_style ( app_icon .icon_label )
791798 app_icon ._icon_loaded = True
792799 return
793800 try :
794801 pixmap = load_and_scale_icon (icon_path , self ._app_icon_size , self ._dpr )
795802 if not pixmap .isNull ():
796803 _ICON_CACHE [cache_key ] = pixmap
797804 app_icon .icon_label .setPixmap (pixmap )
798- app_icon .icon_label . setStyleSheet ( "" )
805+ refresh_widget_style ( app_icon .icon_label )
799806 app_icon ._icon_loaded = True
800807 else :
801808 app_icon .icon_label .setText ("" )
@@ -845,7 +852,7 @@ def _show_context_menu(self, pos, app_data=None, parent_widget=None, event=None)
845852 Show context menu for the launchpad or an app icon
846853 """
847854 menu_parent = parent_widget if parent_widget else self ._launchpad_popup
848- menu = QMenu (menu_parent )
855+ menu = QMenu (menu_parent . window () )
849856 menu .setProperty ("class" , "context-menu" )
850857 qmenu_rounded_corners (menu )
851858
@@ -1421,7 +1428,7 @@ def _on_background_icon_loaded(self, icon_path: str, pixmap: QPixmap):
14211428 if hasattr (app_icon , "app_data" ) and app_icon .app_data .get ("icon" , "" ) == icon_path :
14221429 if hasattr (app_icon , "_icon_loaded" ) and not app_icon ._icon_loaded :
14231430 app_icon .icon_label .setPixmap (pixmap )
1424- app_icon .icon_label . setStyleSheet ( "" )
1431+ refresh_widget_style ( app_icon .icon_label )
14251432 app_icon ._icon_loaded = True
14261433
14271434 def _recalculate_grid_columns (self ):
0 commit comments