Skip to content

Commit

Permalink
Proper Styling to TOC
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaopengLin committed Nov 7, 2024
1 parent df59543 commit f389411
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 1 deletion.
64 changes: 64 additions & 0 deletions resources/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,70 @@ ContentTypeFilter {
height: 0;
}

#tableofcontentbar {
background-color: white;
}

#tableofcontentbar QTreeWidget,
#tableofcontentbar QLabel,
#tableofcontentbar QFrame {
background-color: white;
}

#tableofcontentbar QTreeWidget {
outline: none;
}

#tableofcontentbar QTreeWidget::item {
height: 26px;
padding: 0px 10px;
outline: none;
border-top: 1px solid transparent;
border-bottom: 1px solid transparent;
}

#tableofcontentbar QTreeWidget::item:selected,
#tableofcontentbar QTreeWidget::item:hover {
outline: none;
border-top: 1px solid #3366CC;
border-bottom: 1px solid #3366CC;
background-color: #D9E9FF;
color: black;
}

#tableofcontentbar QTreeWidget::branch:selected,
#tableofcontentbar QTreeWidget::branch:hover {
outline: none;
border-top: 1px solid #3366CC;
border-bottom: 1px solid #3366CC;
background-color: #D9E9FF;
}

#tableofcontentbar QTreeWidget::branch:has-children:closed {
padding: 5px; /* Can only change icon size with padding. */
image: url(:/icons/caret-up-solid.svg);
}

#tableofcontentbar QTreeWidget::branch:has-children {
padding: 5px; /* Can only change icon size with padding. */
image: url(:/icons/caret-down-solid.svg);
}

#tableofcontentbar #titleLabel {
padding: 0px;
margin: 10px;
}

#tableofcontentbar #hideLabel {
margin: 13px 10px 10px; /* 3px to match bottom with titleLabel */
}

#tableofcontentbar QScrollBar {
width: 5px;
border: none;
outline: none;
}

#tableofcontentbar QScrollBar::handle {
background-color: grey;
}
11 changes: 10 additions & 1 deletion src/tableofcontentbar.ui
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
Expand All @@ -44,6 +47,9 @@
<property name="text">
<string/>
</property>
<property name="indent">
<number>0</number>
</property>
</widget>
</item>
<item>
Expand All @@ -64,6 +70,9 @@
<property name="text">
<string/>
</property>
<property name="indent">
<number>0</number>
</property>
</widget>
</item>
</layout>
Expand All @@ -90,7 +99,7 @@
<enum>QAbstractScrollArea::AdjustToContents</enum>
</property>
<property name="textElideMode">
<enum>Qt::ElideNone</enum>
<enum>Qt::ElideRight</enum>
</property>
<property name="indentation">
<number>30</number>
Expand Down

0 comments on commit f389411

Please sign in to comment.