custom background color for 'selected/highlighted text'

83 views
Skip to first unread message

Zoltan Benedek

unread,
Jul 29, 2014, 1:15:01 PM7/29/14
to leo-e...@googlegroups.com
Hi,

Could someone explain to me, how I can customize the background color of highlighted text? (result text of find(Ctrl + F) command)

I have already myLeoSettings.leo with other custom setting:

@settings->@bool enable-abbreviations = True


Thanks

Fidel N

unread,
Jul 29, 2014, 2:01:15 PM7/29/14
to leo-e...@googlegroups.com
Hi Zoltan:
If you are using Qt, could you check if changing the following does the trick?

Go to the node: 
myLeoSettings.leo#@settings-->Qt Gui (appearance)-->@data qt-gui-plugin-style-sheet

Then replace your color in this text:


QTextEdit#richTextEdit {
    background
-color: white; /* #fdf5f5; A kind of pink. */
    color
: @text-foreground-body;
    selection
-color: white;
    selection
-background-color: lightgrey;
    font
-family: @font-family;
   
/* font-family: Courier New; */
    font
-size: @font-size-body;
    font
-weight: normal; /* normal,bold,100,..,900 */
    font
-style: normal; /* normal,italic,oblique */
}

Change the "selection-background-color" to your liking.

Zoltan Benedek

unread,
Jul 30, 2014, 4:52:17 AM7/30/14
to leo-e...@googlegroups.com
Hi Fidel,

Many thanks for the tip, I can change the color I wanted.

Unfortunately I have some font issues with the new setting: the fonts changed in the outline pane and log pane.

I copied the entire section QTextEdit#richTextEdit from leoSettings.leo into a node (@settings-->Qt Gui (appearance)-->@data qt-gui-plugin-style-sheet) and changed only selection-background-color.

The fonts changed in the outline pane and log pane.

Then I copied the entire sections QTextEdit, QTextEdit#richTextEdit from leoSettings.leo into a node (@settings-->Qt Gui (appearance)-->@data qt-gui-plugin-style-sheet) and changed only selection-background-color.

Now I have issue only with the font in the outlines. (The font size is nearly half of the original)

Is there another section I should copy?

Thanks

Zoltan Benedek

unread,
Jul 30, 2014, 5:11:00 AM7/30/14
to leo-e...@googlegroups.com
I've found it.
I should copy the entire node @data qt-gui-plugin-style-sheet and customize what I want.

A lot of thanks.

Fidel N

unread,
Jul 30, 2014, 5:34:25 AM7/30/14
to leo-e...@googlegroups.com
glad you could solve it Zoltan.


--
You received this message because you are subscribed to the Google Groups "leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+...@googlegroups.com.
To post to this group, send email to leo-e...@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages