I love that TreeView control

Ideas for improvements and requests for new features in XnView MP

Moderators: helmut, XnTriq, xnview

Post Reply
Rebellious
Posts: 39
Joined: Tue Jul 22, 2008 4:49 pm

I love that TreeView control

Post 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.
Attachments
Screenshot-xnview.png
Screenshot-xnview.png (60.18 KiB) Viewed 3367 times
User avatar
XnTriq
Moderator & Librarian
Posts: 6512
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: I love that TreeView control

Post 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
Attachments
branch_end.gif
branch_end.gif (64 Bytes) Viewed 3360 times
branch_more.gif
branch_more.gif (67 Bytes) Viewed 3360 times
branch_vline.gif
branch_vline.gif (64 Bytes) Viewed 3360 times
branch_open.gif
branch_open.gif (78 Bytes) Viewed 3360 times
branch_closed.gif
branch_closed.gif (78 Bytes) Viewed 3360 times
User avatar
XnTriq
Moderator & Librarian
Posts: 6512
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: I love that TreeView control

Post 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:
Rebellious
Posts: 39
Joined: Tue Jul 22, 2008 4:49 pm

Re: I love that TreeView control

Post 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));
}
User avatar
XnTriq
Moderator & Librarian
Posts: 6512
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: I love that TreeView control

Post 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
Rebellious
Posts: 39
Joined: Tue Jul 22, 2008 4:49 pm

Re: I love that TreeView control

Post 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.
User avatar
XnTriq
Moderator & Librarian
Posts: 6512
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: I love that TreeView control

Post 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
Rebellious
Posts: 39
Joined: Tue Jul 22, 2008 4:49 pm

Re: I love that TreeView control

Post 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.
User avatar
Schattenreiter
Posts: 43
Joined: Mon Sep 19, 2005 5:46 pm
Location: Berlin, Germany
Contact:

Re: I love that TreeView control

Post by Schattenreiter »

looking superb :)
HackIntosh
Mountain Lion 10.8.2G530GA-Z77M-D3HSapphire 5770Soundblaster Audigy Platinum16GB-1333-DDR3Atheros AR9280
Post Reply