Author |
Message |
Bert

Joined: 30 Jun 2006 Posts: 1106
|
Posted: Sun 09 Feb 2014, 08:32 Post subject:
Gtkdialog: tooltip background: how to fill the whole bg? Subject description: [SOLVED] |
|
Hi all,
With a longer tooltip, I get these grey ends of line.
Here I exaggerated the amount of text a bit for the screenshot:
Code: | <button tooltip-markup="<span fgcolor='"'blue'"' bgcolor='"'lightyellow'"'> '$(gettext 'Lorem ipsum |
Is there a trick to make the tooltip background 100% "light-yellow"?
Thanks in advance!
_________________

Last edited by Bert on Sat 15 Feb 2014, 08:24; edited 1 time in total
|
Back to top
|
|
 |
zigbert

Joined: 29 Mar 2006 Posts: 6541 Location: Valåmoen, Norway
|
Posted: Sun 09 Feb 2014, 10:12 Post subject:
|
|
I don't know the exact code, but you can sure set tooltip colors in an extra gtktheme.
The following example shows to do it (for monospace text).
Code: | #!/bin/bash
echo 'style "specialmono"
{
font_name="Mono 12"
}
widget "*mono" style "specialmono"
class "GtkText*" style "specialmono"' > /tmp/gtkrc_mono
export GTK2_RC_FILES=/tmp/gtkrc_mono:/root/.gtkrc-2.0
export test_app="
<vbox>
<text name=\"mono\"><label>This text-widget uses monospace font....</label></text>
<text><label>...while this text-widget don't.</label></text>
<edit><default>All edit-widgets gets monospace.</default></edit>
</vbox>"
gtkdialog --program=test_app |
_________________ Stardust resources
|
Back to top
|
|
 |
Bert

Joined: 30 Jun 2006 Posts: 1106
|
Posted: Mon 10 Feb 2014, 18:43 Post subject:
|
|
Thank you Zigbert,
I've been trying your idea, but didn't get results.
There was already a global "special" gtktheme in the dialog (as you can see from the fonts in the screenshot above).
At first I tried to integrate the tooltip stuff in that gtktheme. Didn't work. Then I added a new theme, following your example:
Code: | #setting tooltip style...
echo 'style "specialtooltip"
{
font_name="Sans 10"
font_style="bold"
fg[NORMAL]="blue"
bg[NORMAL]="lightyellow"
}
widget "*specialtooltip" style "specialtooltip"
class "GtkTooltip*" style "specialtooltip"' > /tmp/gtkrc_specialtooltip |
Tried another example (from SFR I think):
Code: | #setting tooltip style..
FONT_NAME="Sans"
FONT_SIZE="10"
FONT_STYLE="bold"
echo 'style "custom1"
{
font_name="'$FONT_NAME' '$FONT_STYLE' '$FONT_SIZE'"
fg[NORMAL]="blue"
bg[NORMAL]="lightyellow"
}
widget "*GtkTooltip*" style "custom1" ' > /tmp/gtkrc_custom1
export GTK2_RC_FILES="${HOME}/.gtkrc-2.0:/tmp/gtkrc_custom1"
|
Again no luck.
I'm sure you are right and that it is possible, but I have to give up.
It is also not that important
It taught me to keep tooltips sweet and short...
Thanks again,
Bert
_________________

|
Back to top
|
|
 |
zigbert

Joined: 29 Mar 2006 Posts: 6541 Location: Valåmoen, Norway
|
Posted: Tue 11 Feb 2014, 16:38 Post subject:
|
|
Be aware that some gtk-themes are hard to override. Try the Flat-grey or Stardust, as these has never given trouble for me.
_________________ Stardust resources
|
Back to top
|
|
 |
SFR

Joined: 26 Oct 2011 Posts: 1655
|
Posted: Tue 11 Feb 2014, 17:40 Post subject:
|
|
Did some trials and replacing "*GtkTooltip*" with just "*tooltip*" gave me control over tooltip's style.
Greetings!
_________________ [O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
|
Back to top
|
|
 |
Bert

Joined: 30 Jun 2006 Posts: 1106
|
Posted: Sat 15 Feb 2014, 08:20 Post subject:
|
|
Thanks SFR! Working now
Code: |
#setting tooltip style..
FONT_NAME="Sans"
FONT_SIZE="10"
FONT_STYLE="bold"
echo 'style "customtooltip"
{
font_name="'$FONT_NAME' '$FONT_STYLE' '$FONT_SIZE'"
fg[NORMAL]="blue"
bg[NORMAL]="lightyellow"
}
widget "*tooltip*" style "customtooltip" ' > /tmp/gtkrc_customtooltip
export GTK2_RC_FILES="${HOME}/.gtkrc-2.0:/tmp/gtkrc_customtooltip"
export DIALOG='
<frame>
<edit text-name="tooltip" tooltip-text=" "
|
_________________

|
Back to top
|
|
 |
|