Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 52 additions & 47 deletions resources/css/style.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
QWidget {
background-color: #EAECF0;
color: #000000;
background-color: #DFE1E5;
color: #202124;
}


Expand All @@ -14,7 +14,8 @@ TopWidget {
margin: 0;
padding: 5px;
border: none;
border-bottom: 1px solid #ccc;
border-bottom: 1px solid #DADCE0;
background-color: #FFFFFF;
}

TopWidget::separator {
Expand All @@ -31,48 +32,47 @@ QToolButton {
}

SearchBar {
background-color: white;
background-color: #F1F3F4;
margin: 2px; /* XXX: duplicated in css_constants.h */
border: 1px solid #ccc; /* XXX: duplicated in css_constants.h */
border-radius: 3px;
border: none;
border-radius: 18px;

max-height: 40px;
max-height: 36px;
}
Comment on lines 34 to 41
Copy link

Copilot AI Apr 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SearchBar now sets border: none, but src/css_constants.h still defines CSS::SearchBar::border = 1 and that value is used in geometry calculations (e.g., SearchBarLineEdit::getCompleterRect() in src/searchbar.cpp and SuggestionListDelegate positioning). This mismatch will shift/size the completer incorrectly; update the constant (and any dependent math) to reflect the new CSS border.

Copilot uses AI. Check for mistakes.

SearchBar > QLabel#searchIcon {
padding: 0;
border: none;
background-color: none;
background-color: transparent;
margin: 0px 6px;

max-height: 38px;
max-width: 38px;
max-height: 36px;
max-width: 36px;
}

SearchBar > SearchBarLineEdit {
background-color: white;
background-color: transparent;
margin: 0;
padding: 0;
color: #666;
color: #3C4043;
border: none;
font-size: 16px;
font-size: 15px;

max-height: 38px;
max-height: 36px;
}

SearchBar > QToolButton {
padding: 0;
border: 0 solid #fff;
background-color: none;
max-height: 38px;
max-width: 38px;
border: none;
background-color: transparent;
max-height: 36px;
max-width: 36px;
border-radius: 18px;
}

SearchBar > QToolButton:pressed,
SearchBar > QToolButton:hover {
border: 1px solid #3366CC;
background-color: #D9E9FF;
border-radius: 3px;
background-color: #E8EAED;
}

MultiZimButton QListWidget {
Expand Down Expand Up @@ -123,9 +123,9 @@ ZimItemWidget QRadioButton::indicator:checked {

TopWidget QToolButton:pressed,
TopWidget QToolButton::hover {
Copy link

Copilot AI Apr 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Qt stylesheet pseudo-states use a single colon (:hover). TopWidget QToolButton::hover is treated as a subcontrol selector and won’t match the hover state, so the intended hover styling for toolbar buttons won’t apply.

Suggested change
TopWidget QToolButton::hover {
TopWidget QToolButton:hover {

Copilot uses AI. Check for mistakes.
border: 1px solid #3366CC;
background-color: #D9E9FF;
border-radius: 3px;
background-color: rgba(0, 0, 0, 0.06);
border-radius: 20px;
border: none;
}

TopWidget QToolButton::menu-button {
Expand Down Expand Up @@ -205,9 +205,10 @@ WebViewForwardMenu::icon, WebViewBackMenu::icon {
*/

QTabBar {
font-size: 16px;
icon-size: 24px;
border-bottom: 1px solid #ccc;
font-size: 15px;
icon-size: 20px;
border: none;
background-color: transparent;
}

QTabBar::tear {
Expand All @@ -217,45 +218,49 @@ QTabBar::tear {
}

QTabWidget::pane {
top: -2px;
top: 0px;
border: none;
border-top: 1px solid #ccc;
}

QTabBar::tab {
border: 1px solid #ccc; /* XXX: duplicated in css_constants.h */
border-radius: 0;
padding: 4px; /* XXX: duplicated in css_constants.h */
padding-top: 6px;
background-color: transparent;
border: none;
border-top-left-radius: 12px;
border-top-right-radius: 12px;
padding: 8px 16px;
Comment on lines +227 to +230
Copy link

Copilot AI Apr 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QTabBar::tab styling changed significantly (padding is now 8px 16px and border: none), but src/css_constants.h still has CSS::QTabBar::tab::padding = 4 and border = 1, which is used by src/tabbar.cpp to compute the title drawing rect in paintEvent(). With the updated CSS this will make title positioning/clipping incorrect; keep the constants and the stylesheet in sync (or remove the dependency on hard-coded CSS mirrors).

Suggested change
border: none;
border-top-left-radius: 12px;
border-top-right-radius: 12px;
padding: 8px 16px;
border: 1px solid transparent;
border-top-left-radius: 12px;
border-top-right-radius: 12px;
padding: 4px;

Copilot uses AI. Check for mistakes.
margin-right: 2px;
margin-top: 6px;
min-width: 120px;
}

QTabBar::tab:selected {
background-color: white;
border-bottom: 1px solid white;
QTabBar::tab:hover {
background-color: rgba(255, 255, 255, 0.5);
}

QTabBar::tab:first {
padding-top: 6px;
padding-left: 5px;
QTabBar::tab:selected {
background-color: #FFFFFF;
color: #202124;
}


#closeTabButton, #newTabButton {
font-size: 30px;
width: 30px; min-width: 30px; max-width: 30px;
height: 30px; min-height:30px; max-height:30px;
border-radius: 3px;
font-size: 20px;
width: 28px; min-width: 28px; max-width: 28px;
height: 28px; min-height:28px; max-height:28px;
border-radius: 14px;
}

#nextTabButton, #prevTabButton, #newTabSideButton {
border: 1px solid #ccc;
border: none;
background: transparent;
}

#closeTabButton:hover, #newTabButton:hover,
#nextTabButton:hover, #prevTabButton:hover,
#newTabSideButton:hover {
border: 1px solid #3366CC;
background-color: #D9E9FF;
border-radius: 3px;
background-color: rgba(0, 0, 0, 0.08);
border-radius: 14px;
border: none;
}

QTabBar::scroller {
Expand Down
24 changes: 10 additions & 14 deletions ui/mainwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,16 @@
</item>
</layout>
</item>
<item>
<widget class="TopWidget" name="mainToolBar">
<property name="movable">
<bool>false</bool>
</property>
<property name="floatable">
<bool>false</bool>
</property>
</widget>
Comment on lines +119 to +126
Copy link

Copilot AI Apr 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TopWidget is a QToolBar that assumes its parent is the QMainWindow (e.g., TopWidget::mouseMoveEvent() calls parentWidget()->move(...) to drag the window, and when !SYSTEMTITLEBAR it connects the minimize/close actions to parent slots in src/topwidget.cpp). By placing mainToolBar inside centralWidget's layout, its parent becomes the central widget instead of the main window, which will break window-dragging and can make the minimize/close actions no-ops (missing slots). Keep it as a real main-window toolbar (restore the toolBarArea/toolBarBreak placement) or adjust TopWidget to act on window() / explicitly target MainWindow for those actions.

Copilot uses AI. Check for mistakes.
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
Expand Down Expand Up @@ -162,20 +172,6 @@
</item>
</layout>
</widget>
<widget class="TopWidget" name="mainToolBar">
<property name="movable">
<bool>false</bool>
</property>
<property name="floatable">
<bool>false</bool>
</property>
<attribute name="toolBarArea">
<enum>TopToolBarArea</enum>
</attribute>
<attribute name="toolBarBreak">
<bool>false</bool>
</attribute>
</widget>
</widget>
<layoutdefault spacing="6" margin="11"/>
<customwidgets>
Expand Down
Loading