colors in headline edit

13 views
Skip to first unread message

vitalije

unread,
Mar 31, 2011, 3:25:46 AM3/31/11
to leo-editor
Hello,
I have noticed recently an ugly combination of colors in headline
while editing that was introduced by updating Leo. Background is very
dark and text color is also dark so that it is quite unreadable. I
haven't had enough time to inspect default settings till this morning.
Today I realized that when I start editing headline with Ctrl+h (that
is the usual way I use) both colors (background and foreground) are
dark, but when I double click in headline I see colors from
myLeosettings file.

I am using:
Leo 4.8 final, build 3752, November 26, 2010
Python 2.6.6, qt version 4.7.0
linux2

bzr revno gives me 3904

vitalije

unread,
Mar 31, 2011, 4:05:08 AM3/31/11
to leo-editor
Also I can't figure how to change color of "(" and ")" in
actionscript language. I like dark background with the light text and
that is the color scheme I have in myLeosettings. But "(" and ")" are
black and that is not compatible with my dark background color.

The only two colors in leoSettings (in syntax coloring nodes) that
are black are 'tab_color' and 'operator_color'. I have tried to change
both of them but with no success. Leo sees my settings for tab_color
and operator_color but those settings have no influence on "(" and
")" .

In nodes where @language python is in effect "(" ")" are white, but in
nodes with @language actionscript those characters become black and I
can't find which setting I should change.

vitalije

unread,
Apr 15, 2011, 4:54:33 AM4/15/11
to leo-editor
Today I have updated my Leo and with the revno 4001 the problem is
still present.
And also I haven't found answer on the question about configuring
colors of parenthesis.
I understand those questions are not so high priority but I am just
asking again here in case they got forgotten.
Vitalije.

Edward K. Ream

unread,
May 18, 2011, 1:23:05 PM5/18/11
to leo-editor
I've just added this to the action-items list, which means they are
likely to be fixed first.

Edward

vitalije

unread,
May 19, 2011, 3:00:05 AM5/19/11
to leo-editor
> I've just added this to the action-items list, which means they are
> likely to be fixed first.
Thank you Edward. There was a question in this thread that I still
need an answer, so I will repeat it again.
Vitalije

Edward K. Ream

unread,
May 19, 2011, 7:23:42 AM5/19/11
to leo-e...@googlegroups.com
On Thu, May 19, 2011 at 2:00 AM, vitalije <vita...@gmail.com> wrote:
>> I've just added this to the action-items list, which means they are
>> likely to be fixed first.
> Thank you Edward. There was a question in this thread that I still
> need an answer, so I will repeat it again.
>
> I can't figure how to change color of  "(" and ")" in
> actionscript language.

[snip]

> The only two colors in leoSettings (in syntax coloring nodes)  that
> are black are 'tab_color' and 'operator_color'.

This is already on the action items list, so I'll get around to
looking at this soon.

Edward

Edward K. Ream

unread,
May 22, 2011, 8:42:02 AM5/22/11
to leo-editor
On Mar 31, 2:25 am, vitalije <vitali...@gmail.com> wrote:

> I have noticed recently an ugly combination of colors in headline
> while editing that was introduced by updating Leo. Background is very
> dark and text color is also dark so that it is quite unreadable.

Everything seems to be working as I would expect. However,
stylesheets can be tricky to use.

I suggest disabling any @data qt-gui-plugin-style-sheet nodes in
myLeoSettings.leo and your .leo files, leaving you only with the @data
qt-gui-plugin-style-sheet node in leoSettings.leo. Assuming you
haven't changed that node you will then be sure to have a valid
stylesheet in effect, containing this entry for headlines::

/* Headline edit widgets: widget name does not matter. */
QTreeWidget QLineEdit {
background-color blue: /* #CAE1FF; lightSteelBlue1 */
selection-color: white;
selection-background-color: blue;
font-family: DejaVu Sans Mono;
font-size: 16px;
font-weight: normal; /* normal,bold,100,..,900 */
font-style: normal; /* normal, italic,oblique */
}

Then add items one-by-one to the @data qt-gui-plugin-style-sheet node
in myLeoSettings.leo. I did this myself while investigating this bug
report. Somehow I did something (still don't know what) that
invalidated the entire spreadsheet, and I reconstituted it bit by bit.

HTH.

Edward

Edward K. Ream

unread,
May 22, 2011, 1:24:13 PM5/22/11
to leo-editor
On May 19, 6:23 am, "Edward K. Ream" <edream...@gmail.com> wrote:

> > I can't figure how to change color of  "(" and ")" in
> > actionscript language.

The fix is on the trunk at rev 4109. The actionscript colorizer now
colorizes parens like operators. For example::

@color operator_color = red

Edward

vitalije

unread,
May 23, 2011, 4:06:58 PM5/23/11
to leo-editor

> The fix is on the trunk at rev 4109.  The actionscript colorizer now
> colorizes parens like operators.  For example::

Thanks for this one.
I have tried to disable @data qt-gui-plugin-style-sheet as you have
suggested and colors were changed, but strange behavior was still
present. When I double click in headline I see one set of colors and
when I press Ctrl+H, I see different set of colors (background,
foreground and selection background, selection foreground).
I am using Ubuntu 10.10
Leo Log Window
Leo 4.8 final, build 3752, November 26, 2010
Python 2.6.6, qt version 4.7.0
linux2
revno 4123

I think that colors for editor created by Ctrl+H key combination are
the same regardless of enabling or disabling stylesheet in
myLeosettings.

I am just thinking loud. May be it is PyQt related. Is Leo
responsible for creating headline editor in both cases (double click
and keyboard shortcut) or may be PyQt is responsible for creating
double click editor? If so, how can we tell PyQt to respect our color
settings? As mater of fact, double click created editor looks fine.
The other one does not.

Vitalije

Edward K. Ream

unread,
May 23, 2011, 9:22:14 PM5/23/11
to leo-e...@googlegroups.com
On Mon, May 23, 2011 at 3:06 PM, vitalije <vita...@gmail.com> wrote:

> Is Leo
> responsible for creating headline editor in both cases (double click
> and keyboard shortcut) or may be PyQt is responsible for creating
> double click editor? If so, how can we tell PyQt to respect our color
> settings? As mater of fact, double click created editor looks fine.
> The other one does not.

Strange. Both editors look identical for me.

Leo never creates an outline editor directly. Instead, the qt gui
code gets the editor by calling getTreeEditorForItem::

def getTreeEditorForItem(self,item):

'''Return the edit widget if it exists.
Do *not* create one if it does not exist.'''

w = self.treeWidget
e = w.itemWidget(item,0)
return e

In all cases, at least on Windows 7, but probably also on Linux, the
editor is a QLineEdit. Thus, the stylesheet should definitely apply.

You might want to put a call to g.trace(e) in getTreeEditorForItem to
see what widget you are actually getting.

HTH.

Edward

vitalije

unread,
May 25, 2011, 6:36:36 AM5/25/11
to leo-editor

> You might want to put a call to g.trace(e) in getTreeEditorForItem to
> see what widget you are actually getting.

I have done as you suggested. Whenever I press Ctrl+H, I can see
several lines in terminal some of them says e is None and some of them
says it is QLineEdit.
Here is output:
...
getTreeEditorForItem None
getTreeEditorForItem <PyQt4.QtGui.QLineEdit object at 0xaa3806c>
getTreeEditorForItem <PyQt4.QtGui.QLineEdit object at 0xaa3806c>
getTreeEditorForItem <PyQt4.QtGui.QLineEdit object at 0xaa3806c>
getTreeEditorForItem <PyQt4.QtGui.QLineEdit object at 0xaa3806c>
getTreeEditorForItem <PyQt4.QtGui.QLineEdit object at 0xaa3806c>
getTreeEditorForItem None
...
But, when I double click at headline I have editor but nothing in the
output.
Reply all
Reply to author
Forward
0 new messages