@@ -2585,6 +2585,8 @@ def __init__(self, parent):
2585
2585
self .label_api_key .set_markup ('<a href="https://www.steamgriddb.com/profile/preferences/api">SteamGridDB API Key</a>' )
2586
2586
self .label_api_key .connect ("activate-link" , self .on_link_clicked )
2587
2587
self .entry_api_key = Gtk .Entry ()
2588
+ self .entry_api_key .set_has_tooltip (True )
2589
+ self .entry_api_key .connect ("query-tooltip" , self .on_entry_query_tooltip )
2588
2590
2589
2591
# Create checkbox for 'Start maximized' option
2590
2592
self .checkbox_start_maximized = Gtk .CheckButton (label = "Start maximized" )
@@ -2607,6 +2609,8 @@ def __init__(self, parent):
2607
2609
2608
2610
self .entry_default_prefix = Gtk .Entry ()
2609
2611
self .entry_default_prefix .set_tooltip_text ("/path/to/the/prefix" )
2612
+ self .entry_default_prefix .set_has_tooltip (True )
2613
+ self .entry_default_prefix .connect ("query-tooltip" , self .on_entry_query_tooltip )
2610
2614
self .entry_default_prefix .connect ("changed" , self .on_entry_changed , self .entry_default_prefix )
2611
2615
2612
2616
self .button_search_prefix = Gtk .Button ()
@@ -2878,6 +2882,14 @@ def __init__(self, parent):
2878
2882
self .checkbox_gamemode .set_active (False )
2879
2883
self .checkbox_gamemode .set_tooltip_text ("Tweaks your system to improve performance. NOT INSTALLED." )
2880
2884
2885
+ def on_entry_query_tooltip (self , widget , x , y , keyboard_mode , tooltip ):
2886
+ current_text = widget .get_text ()
2887
+ if current_text .strip ():
2888
+ tooltip .set_text (current_text )
2889
+ else :
2890
+ tooltip .set_text (widget .get_tooltip_text ())
2891
+ return True
2892
+
2881
2893
def on_checkbox_toggled (self , checkbox , option ):
2882
2894
if checkbox .get_active ():
2883
2895
if option == "maximized" :
@@ -3718,6 +3730,8 @@ def __init__(self, parent, game_running2, file_path, api_key, interface_mode):
3718
3730
if interface_mode == "Banners" :
3719
3731
self .entry_title .connect ("focus-out-event" , self .on_entry_focus_out )
3720
3732
self .entry_title .set_tooltip_text ("Game Title" )
3733
+ self .entry_title .set_has_tooltip (True )
3734
+ self .entry_title .connect ("query-tooltip" , self .on_entry_query_tooltip )
3721
3735
3722
3736
# Widgets for path
3723
3737
self .label_path = Gtk .Label (label = "Path" )
@@ -3727,6 +3741,8 @@ def __init__(self, parent, game_running2, file_path, api_key, interface_mode):
3727
3741
if file_path :
3728
3742
self .entry_path .set_text (file_path )
3729
3743
self .entry_path .set_tooltip_text ("/path/to/the/exe" )
3744
+ self .entry_path .set_has_tooltip (True )
3745
+ self .entry_path .connect ("query-tooltip" , self .on_entry_query_tooltip )
3730
3746
self .button_search = Gtk .Button ()
3731
3747
self .button_search .set_image (Gtk .Image .new_from_icon_name ("system-search-symbolic" , Gtk .IconSize .BUTTON ))
3732
3748
self .button_search .connect ("clicked" , self .on_button_search_clicked )
@@ -3738,6 +3754,8 @@ def __init__(self, parent, game_running2, file_path, api_key, interface_mode):
3738
3754
self .entry_prefix = Gtk .Entry ()
3739
3755
self .entry_prefix .connect ("changed" , self .on_entry_changed , self .entry_prefix )
3740
3756
self .entry_prefix .set_tooltip_text ("/path/to/the/prefix" )
3757
+ self .entry_prefix .set_has_tooltip (True )
3758
+ self .entry_prefix .connect ("query-tooltip" , self .on_entry_query_tooltip )
3741
3759
self .button_search_prefix = Gtk .Button ()
3742
3760
self .button_search_prefix .set_image (Gtk .Image .new_from_icon_name ("system-search-symbolic" , Gtk .IconSize .BUTTON ))
3743
3761
self .button_search_prefix .connect ("clicked" , self .on_button_search_prefix_clicked )
@@ -3753,6 +3771,8 @@ def __init__(self, parent, game_running2, file_path, api_key, interface_mode):
3753
3771
self .label_protonfix .set_halign (Gtk .Align .START )
3754
3772
self .entry_protonfix = Gtk .Entry ()
3755
3773
self .entry_protonfix .set_tooltip_text ("UMU ID" )
3774
+ self .entry_protonfix .set_has_tooltip (True )
3775
+ self .entry_protonfix .connect ("query-tooltip" , self .on_entry_query_tooltip )
3756
3776
self .button_search_protonfix = Gtk .Button ()
3757
3777
self .button_search_protonfix .set_image (Gtk .Image .new_from_icon_name ("system-search-symbolic" , Gtk .IconSize .BUTTON ))
3758
3778
self .button_search_protonfix .connect ("clicked" , self .on_button_search_protonfix_clicked )
@@ -3763,19 +3783,25 @@ def __init__(self, parent, game_running2, file_path, api_key, interface_mode):
3763
3783
self .label_launch_arguments .set_halign (Gtk .Align .START )
3764
3784
self .entry_launch_arguments = Gtk .Entry ()
3765
3785
self .entry_launch_arguments .set_tooltip_text ("e.g.: PROTON_USE_WINED3D=1 gamescope -W 2560 -H 1440" )
3786
+ self .entry_launch_arguments .set_has_tooltip (True )
3787
+ self .entry_launch_arguments .connect ("query-tooltip" , self .on_entry_query_tooltip )
3766
3788
3767
3789
# Widgets for game arguments
3768
3790
self .label_game_arguments = Gtk .Label (label = "Game Arguments" )
3769
3791
self .label_game_arguments .set_halign (Gtk .Align .START )
3770
3792
self .entry_game_arguments = Gtk .Entry ()
3771
3793
self .entry_game_arguments .set_tooltip_text ("e.g.: -d3d11 -fullscreen" )
3794
+ self .entry_game_arguments .set_has_tooltip (True )
3795
+ self .entry_game_arguments .connect ("query-tooltip" , self .on_entry_query_tooltip )
3772
3796
3773
3797
# Widgets for extra executable
3774
3798
self .checkbox_addapp = Gtk .CheckButton (label = "Additional Application" )
3775
3799
self .checkbox_addapp .set_tooltip_text ("Additional application to run with the game, like Cheat Engine, Trainers, Mods..." )
3776
3800
self .checkbox_addapp .connect ("toggled" , self .on_checkbox_addapp_toggled )
3777
3801
self .entry_addapp = Gtk .Entry ()
3778
3802
self .entry_addapp .set_tooltip_text ("/path/to/the/app" )
3803
+ self .entry_addapp .set_has_tooltip (True )
3804
+ self .entry_addapp .connect ("query-tooltip" , self .on_entry_query_tooltip )
3779
3805
self .entry_addapp .set_sensitive (False )
3780
3806
self .button_search_addapp = Gtk .Button ()
3781
3807
self .button_search_addapp .set_image (Gtk .Image .new_from_icon_name ("system-search-symbolic" , Gtk .IconSize .BUTTON ))
@@ -4030,6 +4056,14 @@ def __init__(self, parent, game_running2, file_path, api_key, interface_mode):
4030
4056
self .image_banner .set_from_pixbuf (pixbuf )
4031
4057
self .image_banner2 .set_from_pixbuf (pixbuf )
4032
4058
4059
+ def on_entry_query_tooltip (self , widget , x , y , keyboard_mode , tooltip ):
4060
+ current_text = widget .get_text ()
4061
+ if current_text .strip ():
4062
+ tooltip .set_text (current_text )
4063
+ else :
4064
+ tooltip .set_text (widget .get_tooltip_text ())
4065
+ return True
4066
+
4033
4067
def on_image_clicked (self , widget , event ):
4034
4068
self .menu .popup_at_pointer (event )
4035
4069
0 commit comments