Page 1 of 1

I love that TreeView control

Posted: Thu Nov 22, 2012 7:54 pm
by Rebellious
Very meticulously crafted control. They don’t write software like this anymore. Congratulations! :)

Only one suggestion: I’m using mid-tone background, so the dotted lines become invisible, should be black or inverse.

Re: I love that TreeView control

Posted: Thu Nov 22, 2012 11:45 pm
by XnTriq
Add these lines to style_sheet.qss

Code: Select all

QTreeView::branch:has-siblings:!adjoins-item {
border-image: url("UI:branch_vline.gif") 0;
}
QTreeView::branch:has-siblings:adjoins-item {
border-image: url("UI:branch_more.gif") 0;
}
QTreeView::branch:has-children:!has-siblings:closed,
QTreeView::branch:closed:has-children:has-siblings {
border-image: none;
image: url("UI:branch_closed.gif");
}
QTreeView::branch:open:has-children:!has-siblings,
QTreeView::branch:open:has-children:has-siblings {
border-image: none;
image: url("UI:branch_open.gif");
}
QTreeView::branch:!has-children:!has-siblings:adjoins-item {
border-image: url("UI:branch_end.gif") 0;
}
… and place the following files in the UI subdirectory of your XnView MP installation:

Foreground color: #603024 = R96/G48/B36
Background color: #9fcfdb = R159/G207/B219

Re: I love that TreeView control

Posted: Fri Nov 23, 2012 12:45 am
by XnTriq
On second thought: Just adding this “code”…

Code: Select all

QTreeView::item {
color: rgb(0, 0, 0);
}
QTreeView::item:hover,
QTreeView::item:selected:active,
QTreeView::item:selected:!active {
color: rgb(255, 255, 255);
}
… to style_sheet.qss will also do the trick (without the need for any extra images) :mrgreen:

Re: I love that TreeView control

Posted: Fri Nov 23, 2012 4:53 pm
by Rebellious
Thank you, There is style_sheet.qss & style_sheet_linux.qss, the first one has the the following, the 2nd is empty file.

Are these values hardcoded at design time OR dynamically modified by the app at runtime?

Code: Select all

QTreeView::item{
    color: rgb(220,220,220);
    border: 0px solid green;
}

QTreeView::item:alternate{
}

QTreeView::item:selected:!active{
    background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 rgb(80, 80, 80), stop:1 rgb(70, 70, 70));
}

QTreeView::item:selected:active{
    background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 rgb(80, 80, 80), stop:1 rgb(60, 60, 60));
}

QTreeView::item:hover{
    background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 rgb(80, 80, 80), stop:1 rgb(60, 60, 60));
}

Re: I love that TreeView control

Posted: Fri Nov 23, 2012 6:00 pm
by XnTriq
Hi Rebellious
Rebellious wrote:Are these values hardcoded at design time OR dynamically modified by the app at runtime?
I'm a Windows user, but I assume that things are handled not too differently on Linux:
  • %ProgramFiles%\XnViewMP\UI\ = installation (static)
    1. style_sheet.qss
    2. style_sheet_linux.qss
    3. style_sheet_mac.qss
    4. style_sheet_win.qss
  • %AppData%\XnViewMP\ = configuration (dynamic / per user)
    1. style_sheet.qss
    2. style_sheet_win.qss or
      style_sheet_linux.qss
You can edit the config files either manually (text editor) or inside XnViewMP:
  • View » Theme » Dark theme

Re: I love that TreeView control

Posted: Fri Nov 23, 2012 11:44 pm
by Rebellious
Thank you. It didn’t work. I got some very ugly colors all over the app not just the treeview. I had to delete style_sheet.qss in the user dir to get back to default colors. You need some code to set treeview dotted lines color to inverse of background color.

Re: I love that TreeView control

Posted: Sat Nov 24, 2012 3:30 am
by XnTriq
Rebellious wrote:I got some very ugly colors all over the app not just the treeview.
Could you post a screenshot?
What distro (Arch Linux, openSUSE, …) are you on?
Do you use the Cleanlooks theme?
Is the treeview's background turquoise by default on your system?


OK, I'm afraid this a wee bit too complicated for a Linux illiterate :P

Re: I love that TreeView control

Posted: Sat Dec 01, 2012 2:26 pm
by Rebellious
Sorry for my delayed response...




Could you post a screenshot?
As I mentioned above I deleted style_sheet and went back to default, so ugly colors are no longer there but it should be easy to reproduce.

What distro (Arch Linux, openSUSE, …) are you on?
Linux Mint MATE versions 13 & 14

Do you use the Cleanlooks theme?
YEs.

Is the treeview's background turquoise by default on your system?
No, it's part of my selections for system-wide fonts & colors, and xnview ignores these in some cases.

Re: I love that TreeView control

Posted: Sun Dec 30, 2012 2:38 pm
by Schattenreiter
looking superb :)