From 4688ec8e152bcedad50687137e032ae7ad700084 Mon Sep 17 00:00:00 2001 From: zhangjiaping Date: Fri, 16 Apr 2021 15:57:48 +0800 Subject: [PATCH] Add default value for font-size & style-name. --- libsearch/global-settings.cpp | 2 ++ src/control/search-list-view.cpp | 1 - src/custom-style.cpp | 21 +++++++++++++++++++++ src/custom-style.h | 21 +++++++++++++++++++++ 4 files changed, 44 insertions(+), 1 deletion(-) diff --git a/libsearch/global-settings.cpp b/libsearch/global-settings.cpp index 34b7176..e1b7edb 100644 --- a/libsearch/global-settings.cpp +++ b/libsearch/global-settings.cpp @@ -71,6 +71,8 @@ GlobalSettings::GlobalSettings(QObject *parent) : QObject(parent) m_cache.insert(TRANSPARENCY_KEY, m_trans_gsettings->get(TRANSPARENCY_KEY).toDouble()); } + m_cache.insert(STYLE_NAME_KEY, "ukui-light"); + m_cache.insert(FONT_SIZE_KEY, 11); if (QGSettings::isSchemaInstalled(THEME_GSETTINGS_ID)) { m_theme_gsettings = new QGSettings(THEME_GSETTINGS_ID, QByteArray(), this); connect(m_theme_gsettings, &QGSettings::changed, this, [=](const QString& key) { diff --git a/src/control/search-list-view.cpp b/src/control/search-list-view.cpp index a4ddca6..818da9c 100644 --- a/src/control/search-list-view.cpp +++ b/src/control/search-list-view.cpp @@ -39,7 +39,6 @@ SearchListView::SearchListView(QWidget * parent, const QStringList& list, const this->setHeaderHidden(true); this->setColumnWidth(0, 20); this->setColumnWidth(1, 80); - rowheight = this->rowHeight(this->model()->index(0, 0, QModelIndex())) + 1; this->setFixedHeight(list.count() * rowheight + 4); this->setAttribute(Qt::WA_TranslucentBackground, true); this->setAutoFillBackground(false); diff --git a/src/custom-style.cpp b/src/custom-style.cpp index 2e82aa8..9aa3429 100644 --- a/src/custom-style.cpp +++ b/src/custom-style.cpp @@ -1,3 +1,24 @@ +/* + * + * Copyright (C) 2020, KylinSoft Co., Ltd. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * Authors: zhangjiaping + * + */ + #include "custom-style.h" CustomStyle::CustomStyle(const QString &proxyStyleName, QObject *parent) : QProxyStyle(proxyStyleName) diff --git a/src/custom-style.h b/src/custom-style.h index c220bc5..79ccad8 100644 --- a/src/custom-style.h +++ b/src/custom-style.h @@ -1,3 +1,24 @@ +/* + * + * Copyright (C) 2020, KylinSoft Co., Ltd. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * Authors: zhangjiaping + * + */ + #ifndef CUSTOMSTYLE_H #define CUSTOMSTYLE_H #include