Add styles for KiwixChoiceBox

Added styles for KiwixChoiceBox to make it match the model.
Also moved everything in contentmanagerside more to the left.
This commit is contained in:
Nikhil Tanwar 2023-08-15 10:41:51 +05:30 committed by Matthieu Gautier
parent bca0bb3a7a
commit fd371d2a47
8 changed files with 45 additions and 2 deletions

View File

@ -1,4 +1,5 @@
QListWidget::item {
color: #666666;
padding: 0;
padding-top: 6px;
padding-bottom: 6px;
@ -15,6 +16,11 @@ QListWidget::item::selected {
background-color: transparent;
}
QListWidget::item::hover {
color: white;
background-color: #4e63ad;
}
QLineEdit {
padding: 4px;
border: 0;

View File

@ -8,3 +8,16 @@
height: 32px;
line-height: 24px;
}
QScrollArea {
border: 0;
}
#allFileButton, #localFileButton, #contentTypeButton {
padding-left: 2px;
}
#allFileButton::indicator, #localFileButton::indicator, #contentTypeButton::indicator {
height: 0;
width: 0;
}

View File

@ -5,5 +5,6 @@
<file>css/localServer.css</file>
<file>css/confirmBox.css</file>
<file>css/contentmanagerside.css</file>
<file>css/choiceBox.css</file>
</qresource>
</RCC>

View File

@ -9,6 +9,10 @@ ChoiceItem::ChoiceItem(QString key, QString value, QWidget *parent) :
m_value(value)
{
ui->setupUi(this);
QFile file(QString::fromUtf8(":/css/choiceBox.css"));
file.open(QFile::ReadOnly);
QString styleSheet = QString(file.readAll());
this->setStyleSheet(styleSheet);
ui->itemLabel->setText(key);
ui->itemLabel->setToolTip(key);
connect(ui->closeButton, &QPushButton::clicked, [=](){

View File

@ -50,8 +50,6 @@ ContentManagerSide::ContentManagerSide(QWidget *parent) :
connect(mp_contentTypeButton, &QCheckBox::toggled, this, [=](bool checked) {
mp_ui->contentTypeSelector->setHidden(!checked);
mp_ui->contentTypeButton->setIcon(checked ? QIcon(":/icons/caret-down-solid.svg") : QIcon(":/icons/caret-right-solid.svg"));
});
mp_ui->contentTypeSelector->setHidden(true);

View File

@ -62,6 +62,9 @@
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
<property name="leftMargin">
<number>9</number>
</property>
<item>
<widget class="QLineEdit" name="searcher"/>
</item>
@ -82,6 +85,12 @@
<attribute name="buttonGroup">
<string notr="true">buttonGroup</string>
</attribute>
<property name="iconSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</widget>
</item>
<item>

View File

@ -18,6 +18,11 @@ KiwixChoiceBox::KiwixChoiceBox(QWidget *parent) :
{
m_defaultItem = nullptr;
ui->setupUi(this);
QFile file(QString::fromUtf8(":/css/choiceBox.css"));
file.open(QFile::ReadOnly);
QString styleSheet = QString(file.readAll());
this->setStyleSheet(styleSheet);
ui->clearButton->setText(gt("clear"));
ui->clearButton->setToolTip(gt("clear-filter"));
@ -32,6 +37,7 @@ KiwixChoiceBox::KiwixChoiceBox(QWidget *parent) :
choiceSelector->setVerticalScrollMode(QAbstractItemView::ScrollMode::ScrollPerPixel);
choiceSelector->setFocusPolicy(Qt::FocusPolicy::NoFocus);
choiceSelector->setVerticalScrollBarPolicy(Qt::ScrollBarPolicy::ScrollBarAlwaysOff);
choiceSelector->setStyleSheet(styleSheet);
choiceSelector->setSelectionMode(QAbstractItemView::SelectionMode::MultiSelection);
currentChoicesLayout = new FlowLayout(ui->currentChoices, 2, 2, 2);

View File

@ -16,6 +16,12 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="windowTitle">
<string>Form</string>
</property>