mirror of
https://github.com/kiwix/kiwix-desktop.git
synced 2025-09-08 11:45:09 -04:00
Refactor New Tab Button
Set proper size. Added new persistent new tab button.
This commit is contained in:
parent
e84f60b2e7
commit
999f37fcb3
@ -201,12 +201,13 @@ QTabBar::tab:first {
|
|||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#nextTabButton, #prevTabButton {
|
#nextTabButton, #prevTabButton, #newTabSideButton {
|
||||||
border: 1px solid #ccc;
|
border: 1px solid #ccc;
|
||||||
}
|
}
|
||||||
|
|
||||||
#closeTabButton:hover, #newTabButton:hover,
|
#closeTabButton:hover, #newTabButton:hover,
|
||||||
#nextTabButton:hover, #prevTabButton:hover{
|
#nextTabButton:hover, #prevTabButton:hover,
|
||||||
|
#newTabSideButton:hover {
|
||||||
border: 1px solid #3366CC;
|
border: 1px solid #3366CC;
|
||||||
background-color: #D9E9FF;
|
background-color: #D9E9FF;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
|
@ -27,6 +27,7 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||||||
addAction(app->getAction(KiwixApp::NextTabAction));
|
addAction(app->getAction(KiwixApp::NextTabAction));
|
||||||
addAction(app->getAction(KiwixApp::PreviousTabAction));
|
addAction(app->getAction(KiwixApp::PreviousTabAction));
|
||||||
|
|
||||||
|
mp_ui->newTabSideButton->setDefaultAction(app->getAction(KiwixApp::NewTabAction));
|
||||||
mp_ui->nextTabButton->setDefaultAction(app->getAction(KiwixApp::ScrollNextTabAction));
|
mp_ui->nextTabButton->setDefaultAction(app->getAction(KiwixApp::ScrollNextTabAction));
|
||||||
mp_ui->prevTabButton->setDefaultAction(app->getAction(KiwixApp::ScrollPreviousTabAction));
|
mp_ui->prevTabButton->setDefaultAction(app->getAction(KiwixApp::ScrollPreviousTabAction));
|
||||||
|
|
||||||
|
@ -252,7 +252,7 @@ QSize TabBar::tabSizeHint(int index) const
|
|||||||
{
|
{
|
||||||
QWidget *w = mp_stackedWidget->widget(index);
|
QWidget *w = mp_stackedWidget->widget(index);
|
||||||
|
|
||||||
if (w && qobject_cast<ContentManagerView*>(w))
|
if ((w && qobject_cast<ContentManagerView*>(w)) || index >= count() - 1)
|
||||||
return QSize(40, 40); // the "Library" tab is only icon
|
return QSize(40, 40); // the "Library" tab is only icon
|
||||||
|
|
||||||
return QSize(205, 40); // "Settings" and content tabs have text
|
return QSize(205, 40); // "Settings" and content tabs have text
|
||||||
|
@ -71,6 +71,29 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="TabBar" name="tabBar" native="true"/>
|
<widget class="TabBar" name="tabBar" native="true"/>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QToolButton" name="newTabSideButton">
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../resources/kiwix.qrc">
|
||||||
|
<normaloff>:/icons/new-tab-icon.svg</normaloff>:/icons/new-tab-icon.svg</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="iconSize">
|
||||||
|
<size>
|
||||||
|
<width>16</width>
|
||||||
|
<height>16</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QToolButton" name="nextTabButton">
|
<widget class="QToolButton" name="nextTabButton">
|
||||||
<property name="maximumSize">
|
<property name="maximumSize">
|
||||||
@ -179,6 +202,8 @@
|
|||||||
<container>1</container>
|
<container>1</container>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<resources/>
|
<resources>
|
||||||
|
<include location="../resources/kiwix.qrc"/>
|
||||||
|
</resources>
|
||||||
<connections/>
|
<connections/>
|
||||||
</ui>
|
</ui>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user