Akascape / CTkToolTip

Small pop-up widget for displaying details inside customtkinter. (extension/add-on)
Creative Commons Zero v1.0 Universal
111 stars 7 forks source link

v0.4: Toolltip Rendering on Windows #10

Closed avalon60 closed 1 year ago

avalon60 commented 1 year ago

Hi @Akascape. I am using the latest PyPi version and I am encountering a similar problem with CTkToolTip on Windows as experienced with the CTkMessagebox widget (which you were able to quickly fix).

On Linux I get this:

LinuxTooltip

However, on Windows, the text can be very hard to read:

WindowsTooltip

Is it possible to use a similar fix as applied previously on CTkMessagebox , to CTkToolTip?

Thanks.

Akascape commented 1 year ago

@avalon60 Lol, same story with this one. Will fix later.

avalon60 commented 1 year ago

Thanks!

avalon60 commented 1 year ago

Hi @Akascape. Any idea when a fix will be made available on this?

Akascape commented 1 year ago

@Akascape Ok I fixed it, update to the new version 0.5

avalon60 commented 1 year ago

Hi @Akascape . I just tested and unfortunately it still doesn't work:

image

I double checked the installed version:

image

Akascape commented 1 year ago

@avalon60 Update again, I forgot to add one commit.

avalon60 commented 1 year ago

Hi @Akascape, it still looks wrong:

image

image

avalon60 commented 1 year ago

Here's the theme, if it helps:

Harlequin.zip

Akascape commented 1 year ago

@avalon60 umm, can you try passing the alpha=1 parameter in ctktooltip.

avalon60 commented 1 year ago

@Akascape, that stops it for most instances, except there is an issue with a CTkLabel attached to a tab on a CTkTabview:

image

Code:

        # CTkTabview
        self.tabview = ctk.CTkTabview(master=widget_frame, width=250)
        self.tabview.grid(row=10, column=2, padx=(20, 10), pady=(20, 10), sticky="nsew")
        self.tabview.add("CTkTabview")
        self.tabview.add("Tab 2")
        self.tabview.add("Tab 3")
        self.label_tab_1 = ctk.CTkLabel(self.tabview.tab("CTkTabview"), justify='left',
                                        text="I've seen things you people\nwouldn't believe...\n\nAttack ships on fire "
                                             "off\nthe shoulder of Orion...")
        self.label_tab_1.grid(row=0, column=2, padx=20, pady=20)

        self.label_tab_2 = ctk.CTkLabel(self.tabview.tab("Tab 2"), justify='left',
                                        text="I watched C-beams glitter in\nthe dark near the Tannhäuser\nGate.")
        self.label_tab_2.grid(row=0, column=0, padx=20, pady=20)

        self.label_tab_3 = ctk.CTkLabel(self.tabview.tab("Tab 3"), justify='left',
                                        text="All those moments will be\nlost in time, like tears\nin rain...\n\n\n"
                                             "Time to die.")
        self.label_tab_3.grid(row=0, column=0, padx=20, pady=20, sticky='nsew')

        if self._enable_tooltips:
            label_tab_1_tooltip = CTkToolTip(self.label_tab_1,
                                             justify="left",
                                             wraplength=250,
                                             x_offset=-120,
                                             alpha=1,
                                             padding=(5, 5),
                                             message='The CTkTabview is a composite widget. As of CustomTkinter v5, '
                                                     'it has no direct default properties. instead it borrows from '
                                                     'CTkFrame and CTkSegmentedButton.\n\n'
                                                     'The text in the main body of the CTkTabview preview, '
                                                     'is produced via an embedded CTkLabel.')
Akascape commented 1 year ago

@avalon60 thanks for providing the theme, it was actually a theme issue and I fixed it finally.

avalon60 commented 1 year ago

@Akascape, this is still not working at my end. None of the tooltips, irrespective of the widget type they are applied to, render clearly - kind of muddied. This also occurs on the CustomTkinter supplied themes. Example, blue theme:

image

Green theme:

image

Akascape commented 1 year ago

@avalon60 Everything is working, you just need to set alpha=1. It is a transparency effect set as 0.8 default. A little transparency looks good, but as your text is big, you need to set it to 1.

avalon60 commented 1 year ago

@Akascape, a little transparency, as we have seen, doesn't look good - it makes it impractical to use. I am surprised it's enabled by default. For another thing you get differing results across platforms, making it difficult to develop with any consistency,

Thanks.

Akascape commented 1 year ago

@avalon60 I will change the default to 0.95.

For another thing you get differing results across platforms, making it difficult to develop with any consistency,

Idk but all other platforms show different looks when it comes to GUI development.

avalon60 commented 1 year ago

Sure there are differences to some of the base widgets, for reasons of O/S specific look and feel, but why add to that unnecessarily? Especially when the result looks compromised aesthetically, and also when it makes it unusable to-boot .

It's good to make it flexible, but the default settings should be fairly vanilla, so that you aren't imposing choices onto the developer.