forked from openkylin/ukui-search
Change the color of the lines which are on the detail page in night mode.
This commit is contained in:
parent
0d9197fa06
commit
67c134bc17
|
@ -148,10 +148,7 @@ void AppSearchPlugin::initDetailPage()
|
|||
m_nameFrameLyt->addStretch();
|
||||
m_nameFrameLyt->addWidget(m_pluginLabel);
|
||||
|
||||
m_line_1 = new QFrame(m_detailPage);
|
||||
m_line_1->setLineWidth(0);
|
||||
m_line_1->setFixedHeight(1);
|
||||
m_line_1->setStyleSheet("QFrame{background: rgba(0,0,0,0.2);}");
|
||||
m_line_1 = new SeparationLine(m_detailPage);
|
||||
m_descFrame = new QFrame(m_detailPage);
|
||||
m_descFrameLyt = new QVBoxLayout(m_descFrame);
|
||||
m_descLabel = new QLabel(m_descFrame);
|
||||
|
@ -160,10 +157,7 @@ void AppSearchPlugin::initDetailPage()
|
|||
m_descFrameLyt->addWidget(m_descLabel);
|
||||
m_descFrame->setLayout(m_descFrameLyt);
|
||||
m_descFrameLyt->setContentsMargins(8, 0, 0, 0);
|
||||
m_line_2 = new QFrame(m_detailPage);
|
||||
m_line_2->setLineWidth(0);
|
||||
m_line_2->setFixedHeight(1);
|
||||
m_line_2->setStyleSheet("QFrame{background: rgba(0,0,0,0.2);}");
|
||||
m_line_2 = new SeparationLine(m_detailPage);
|
||||
|
||||
m_actionFrame = new QFrame(m_detailPage);
|
||||
m_actionFrameLyt = new QVBoxLayout(m_actionFrame);
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#include "search-plugin-iface.h"
|
||||
#include "app-match.h"
|
||||
#include "action-label.h"
|
||||
#include "separation-line.h"
|
||||
#include "libsearch_global.h"
|
||||
namespace UkuiSearch {
|
||||
class LIBSEARCH_EXPORT AppSearchPlugin : public QObject, public SearchPluginIface
|
||||
|
@ -55,11 +56,11 @@ private:
|
|||
QHBoxLayout *m_nameFrameLyt = nullptr;
|
||||
QLabel *m_nameLabel = nullptr;
|
||||
QLabel *m_pluginLabel = nullptr;
|
||||
QFrame *m_line_1 = nullptr;
|
||||
SeparationLine *m_line_1 = nullptr;
|
||||
QFrame *m_descFrame = nullptr;
|
||||
QLabel *m_descLabel = nullptr;
|
||||
QVBoxLayout *m_descFrameLyt = nullptr;
|
||||
QFrame *m_line_2 = nullptr;
|
||||
SeparationLine *m_line_2 = nullptr;
|
||||
QFrame *m_actionFrame = nullptr;
|
||||
QVBoxLayout *m_actionFrameLyt = nullptr;
|
||||
ActionLabel *m_actionLabel1 = nullptr;
|
||||
|
|
|
@ -121,10 +121,7 @@ void FileSearchPlugin::initDetailPage()
|
|||
m_nameFrameLyt->addStretch();
|
||||
m_nameFrameLyt->addWidget(m_pluginLabel);
|
||||
|
||||
m_line_1 = new QFrame(m_detailPage);
|
||||
m_line_1->setLineWidth(0);
|
||||
m_line_1->setFixedHeight(1);
|
||||
m_line_1->setStyleSheet("QFrame{background: rgba(0,0,0,0.2);}");
|
||||
m_line_1 = new SeparationLine(m_detailPage);
|
||||
|
||||
m_pathFrame = new QFrame(m_detailPage);
|
||||
m_pathFrameLyt = new QHBoxLayout(m_pathFrame);
|
||||
|
@ -147,10 +144,7 @@ void FileSearchPlugin::initDetailPage()
|
|||
m_timeFrameLyt->addStretch();
|
||||
m_timeFrameLyt->addWidget(m_timeLabel2);
|
||||
|
||||
m_line_2 = new QFrame(m_detailPage);
|
||||
m_line_2->setLineWidth(0);
|
||||
m_line_2->setFixedHeight(1);
|
||||
m_line_2->setStyleSheet("QFrame{background: rgba(0,0,0,0.2);}");
|
||||
m_line_2 = new SeparationLine(m_detailPage);
|
||||
|
||||
m_actionFrame = new QFrame(m_detailPage);
|
||||
m_actionFrameLyt = new QVBoxLayout(m_actionFrame);
|
||||
|
@ -318,10 +312,7 @@ void DirSearchPlugin::initDetailPage()
|
|||
m_nameFrameLyt->addStretch();
|
||||
m_nameFrameLyt->addWidget(m_pluginLabel);
|
||||
|
||||
m_line_1 = new QFrame(m_detailPage);
|
||||
m_line_1->setLineWidth(0);
|
||||
m_line_1->setFixedHeight(1);
|
||||
m_line_1->setStyleSheet("QFrame{background: rgba(0,0,0,0.2);}");
|
||||
m_line_1 = new SeparationLine(m_detailPage);
|
||||
|
||||
m_pathFrame = new QFrame(m_detailPage);
|
||||
m_pathFrameLyt = new QHBoxLayout(m_pathFrame);
|
||||
|
@ -344,10 +335,7 @@ void DirSearchPlugin::initDetailPage()
|
|||
m_timeFrameLyt->addStretch();
|
||||
m_timeFrameLyt->addWidget(m_timeLabel2);
|
||||
|
||||
m_line_2 = new QFrame(m_detailPage);
|
||||
m_line_2->setLineWidth(0);
|
||||
m_line_2->setFixedHeight(1);
|
||||
m_line_2->setStyleSheet("QFrame{background: rgba(0,0,0,0.2);}");
|
||||
m_line_2 = new SeparationLine(m_detailPage);
|
||||
|
||||
m_actionFrame = new QFrame(m_detailPage);
|
||||
m_actionFrameLyt = new QVBoxLayout(m_actionFrame);
|
||||
|
@ -555,10 +543,7 @@ void FileContengSearchPlugin::initDetailPage()
|
|||
m_nameFrameLyt->addStretch();
|
||||
m_nameFrameLyt->addWidget(m_pluginLabel);
|
||||
|
||||
m_line_1 = new QFrame(m_detailPage);
|
||||
m_line_1->setLineWidth(0);
|
||||
m_line_1->setFixedHeight(1);
|
||||
m_line_1->setStyleSheet("QFrame{background: rgba(0,0,0,0.2);}");
|
||||
m_line_1 = new SeparationLine(m_detailPage);
|
||||
|
||||
m_snippetLabel = new QLabel(m_detailPage);
|
||||
// m_snippetLabel->setWordWrap(true);
|
||||
|
@ -585,10 +570,7 @@ void FileContengSearchPlugin::initDetailPage()
|
|||
m_timeFrameLyt->addStretch();
|
||||
m_timeFrameLyt->addWidget(m_timeLabel2);
|
||||
|
||||
m_line_2 = new QFrame(m_detailPage);
|
||||
m_line_2->setLineWidth(0);
|
||||
m_line_2->setFixedHeight(1);
|
||||
m_line_2->setStyleSheet("QFrame{background: rgba(0,0,0,0.2);}");
|
||||
m_line_2 = new SeparationLine(m_detailPage);
|
||||
|
||||
m_actionFrame = new QFrame(m_detailPage);
|
||||
m_actionFrameLyt = new QVBoxLayout(m_actionFrame);
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
#include "search-plugin-iface.h"
|
||||
#include "common.h"
|
||||
#include "action-label.h"
|
||||
#include "separation-line.h"
|
||||
namespace UkuiSearch {
|
||||
//internal plugin
|
||||
class LIBSEARCH_EXPORT FileSearchPlugin : public QObject, public SearchPluginIface
|
||||
|
@ -46,7 +47,7 @@ private:
|
|||
QHBoxLayout *m_nameFrameLyt = nullptr;
|
||||
QLabel *m_nameLabel = nullptr;
|
||||
QLabel *m_pluginLabel = nullptr;
|
||||
QFrame *m_line_1 = nullptr;
|
||||
SeparationLine *m_line_1 = nullptr;
|
||||
QFrame *m_pathFrame = nullptr;
|
||||
QLabel *m_pathLabel1 = nullptr;
|
||||
QLabel *m_pathLabel2 = nullptr;
|
||||
|
@ -56,7 +57,7 @@ private:
|
|||
QLabel *m_timeLabel2 = nullptr;
|
||||
QHBoxLayout *m_timeFrameLyt = nullptr;
|
||||
|
||||
QFrame *m_line_2 = nullptr;
|
||||
SeparationLine *m_line_2 = nullptr;
|
||||
QFrame *m_actionFrame = nullptr;
|
||||
QVBoxLayout *m_actionFrameLyt = nullptr;
|
||||
ActionLabel *m_actionLabel1 = nullptr;
|
||||
|
@ -99,7 +100,7 @@ private:
|
|||
QHBoxLayout *m_nameFrameLyt = nullptr;
|
||||
QLabel *m_nameLabel = nullptr;
|
||||
QLabel *m_pluginLabel = nullptr;
|
||||
QFrame *m_line_1 = nullptr;
|
||||
SeparationLine *m_line_1 = nullptr;
|
||||
QFrame *m_pathFrame = nullptr;
|
||||
QLabel *m_pathLabel1 = nullptr;
|
||||
QLabel *m_pathLabel2 = nullptr;
|
||||
|
@ -109,7 +110,7 @@ private:
|
|||
QLabel *m_timeLabel2 = nullptr;
|
||||
QHBoxLayout *m_timeFrameLyt = nullptr;
|
||||
|
||||
QFrame *m_line_2 = nullptr;
|
||||
SeparationLine *m_line_2 = nullptr;
|
||||
QFrame *m_actionFrame = nullptr;
|
||||
QVBoxLayout *m_actionFrameLyt = nullptr;
|
||||
ActionLabel *m_actionLabel1 = nullptr;
|
||||
|
@ -154,7 +155,7 @@ private:
|
|||
QHBoxLayout *m_nameFrameLyt = nullptr;
|
||||
QLabel *m_nameLabel = nullptr;
|
||||
QLabel *m_pluginLabel = nullptr;
|
||||
QFrame *m_line_1 = nullptr;
|
||||
SeparationLine *m_line_1 = nullptr;
|
||||
QLabel *m_snippetLabel = nullptr;
|
||||
QFrame *m_pathFrame = nullptr;
|
||||
QLabel *m_pathLabel1 = nullptr;
|
||||
|
@ -165,7 +166,7 @@ private:
|
|||
QLabel *m_timeLabel2 = nullptr;
|
||||
QHBoxLayout *m_timeFrameLyt = nullptr;
|
||||
|
||||
QFrame *m_line_2 = nullptr;
|
||||
SeparationLine *m_line_2 = nullptr;
|
||||
QFrame *m_actionFrame = nullptr;
|
||||
QVBoxLayout *m_actionFrameLyt = nullptr;
|
||||
ActionLabel *m_actionLabel1 = nullptr;
|
||||
|
|
|
@ -9,7 +9,6 @@ using namespace UkuiSearch;
|
|||
#define DETAIL_ICON_HEIGHT 128
|
||||
#define NAME_LABEL_MARGINS 8, 0, 0, 0
|
||||
#define NAME_LABEL_WIDTH 282
|
||||
#define LINE_STYLE "QFrame{background: rgba(0, 0, 0, 0.2);}"
|
||||
#define DETAIL_ACTION_MARGINS 8, 0, 0, 0
|
||||
#define DESC_PAGE_WIDTH 316
|
||||
#define DESC_LABEL_MARGINS 0, 0, 0, 0
|
||||
|
@ -142,10 +141,7 @@ void MailSearchPlugin::initDetailPage()
|
|||
m_nameFrameLyt->addStretch();
|
||||
m_nameFrameLyt->addWidget(m_pluginLabel);
|
||||
|
||||
m_line_1 = new QFrame(m_detailPage);
|
||||
m_line_1->setLineWidth(0);
|
||||
m_line_1->setFixedHeight(1);
|
||||
m_line_1->setStyleSheet(LINE_STYLE);
|
||||
m_line_1 = new SeparationLine(m_detailPage);
|
||||
|
||||
m_descListArea = new MailDescArea(m_detailPage);
|
||||
QPalette scroll_bar_pal = m_descListArea->verticalScrollBar()->palette();
|
||||
|
@ -218,10 +214,7 @@ void MailSearchPlugin::initDetailPage()
|
|||
m_descPageLyt->addRow(m_ccLabel, m_ccFieldsLabel);
|
||||
// m_descPageLyt->addRow(m_attachmentLabel, m_attachmentFieldsLabel);
|
||||
|
||||
m_line_2 = new QFrame(m_detailPage);
|
||||
m_line_2->setLineWidth(0);
|
||||
m_line_2->setFixedHeight(1);
|
||||
m_line_2->setStyleSheet(LINE_STYLE);
|
||||
m_line_2 = new SeparationLine(m_detailPage);
|
||||
|
||||
m_actionFrame = new QFrame(m_detailPage);
|
||||
m_actionFrameLyt = new QVBoxLayout(m_actionFrame);
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include <qt5xdg/xdgicon.h>
|
||||
#include "search-plugin-iface.h"
|
||||
#include "action-label.h"
|
||||
#include "separation-line.h"
|
||||
#include "libsearch_global.h"
|
||||
namespace UkuiSearch {
|
||||
|
||||
|
@ -71,7 +72,7 @@ private:
|
|||
QHBoxLayout *m_nameFrameLyt = nullptr;
|
||||
QLabel *m_nameLabel = nullptr;
|
||||
QLabel *m_pluginLabel = nullptr;
|
||||
QFrame *m_line_1 = nullptr;
|
||||
SeparationLine *m_line_1 = nullptr;
|
||||
|
||||
MailDescArea *m_descListArea = nullptr;
|
||||
QWidget *m_descPage = nullptr;
|
||||
|
@ -91,7 +92,7 @@ private:
|
|||
QTextBrowser *m_ccFieldsLabel = nullptr;
|
||||
QLabel *m_attachmentFieldsLabel = nullptr;
|
||||
|
||||
QFrame *m_line_2 = nullptr;
|
||||
SeparationLine *m_line_2 = nullptr;
|
||||
QFrame *m_actionFrame = nullptr;
|
||||
QVBoxLayout *m_actionFrameLyt = nullptr;
|
||||
ActionLabel *m_actionLabel1 = nullptr;
|
||||
|
|
|
@ -100,10 +100,8 @@ void NoteSearchPlugin::initDetailPage()
|
|||
m_nameFrameLyt->addStretch();
|
||||
m_nameFrameLyt->addWidget(m_pluginLabel);
|
||||
|
||||
m_line_1 = new QFrame(m_detailPage);
|
||||
m_line_1->setLineWidth(0);
|
||||
m_line_1->setFixedHeight(1);
|
||||
m_line_1->setStyleSheet("QFrame{background: rgba(0,0,0,0.2);}");
|
||||
m_line_1 = new SeparationLine(m_detailPage);
|
||||
|
||||
m_descFrame = new QFrame(m_detailPage);
|
||||
m_descFrameLyt = new QVBoxLayout(m_descFrame);
|
||||
m_descLabel = new QLabel(m_descFrame);
|
||||
|
@ -112,15 +110,8 @@ void NoteSearchPlugin::initDetailPage()
|
|||
m_descFrameLyt->addWidget(m_descLabel);
|
||||
m_descFrame->setLayout(m_descFrameLyt);
|
||||
m_descFrameLyt->setContentsMargins(8, 0, 0, 0);
|
||||
m_line_2 = new QFrame(m_detailPage);
|
||||
m_line_2->setLineWidth(0);
|
||||
m_line_2->setFixedHeight(1);
|
||||
m_line_2->setStyleSheet("QFrame{background: rgba(0,0,0,0.2);}");
|
||||
|
||||
m_line_1 = new QFrame(m_detailPage);
|
||||
m_line_1->setLineWidth(0);
|
||||
m_line_1->setFixedHeight(1);
|
||||
m_line_1->setStyleSheet("QFrame{background: rgba(0,0,0,0.2);}");
|
||||
m_line_2 = new SeparationLine(m_detailPage);
|
||||
|
||||
m_actionFrame = new QFrame(m_detailPage);
|
||||
m_actionFrameLyt = new QVBoxLayout(m_actionFrame);
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
#include <typeinfo>
|
||||
#include "search-plugin-iface.h"
|
||||
#include "action-label.h"
|
||||
#include "separation-line.h"
|
||||
#include "libsearch_global.h"
|
||||
namespace UkuiSearch {
|
||||
|
||||
|
@ -55,11 +56,11 @@ private:
|
|||
QHBoxLayout *m_nameFrameLyt = nullptr;
|
||||
QLabel *m_nameLabel = nullptr;
|
||||
QLabel *m_pluginLabel = nullptr;
|
||||
QFrame *m_line_1 = nullptr;
|
||||
SeparationLine *m_line_1 = nullptr;
|
||||
QFrame *m_descFrame = nullptr;
|
||||
QLabel *m_descLabel = nullptr;
|
||||
QVBoxLayout *m_descFrameLyt = nullptr;
|
||||
QFrame *m_line_2 = nullptr;
|
||||
SeparationLine *m_line_2 = nullptr;
|
||||
QFrame *m_actionFrame = nullptr;
|
||||
QVBoxLayout *m_actionFrameLyt = nullptr;
|
||||
ActionLabel *m_actionLabel1 = nullptr;
|
||||
|
|
|
@ -5,9 +5,11 @@ HEADERS += \
|
|||
$$PWD/common-defines.h \
|
||||
$$PWD/plugin-iface.h \
|
||||
$$PWD/search-plugin-iface.h \
|
||||
$$PWD/search-task-plugin-iface.h \
|
||||
$$PWD/data-queue.h \
|
||||
$$PWD/search-task-plugin-iface.h
|
||||
$$PWD/separation-line.h
|
||||
|
||||
SOURCES += \
|
||||
$$PWD/action-label.cpp
|
||||
$$PWD/action-label.cpp \
|
||||
$$PWD/separation-line.cpp
|
||||
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
#include "separation-line.h"
|
||||
#include "global-settings.h"
|
||||
|
||||
#define NOMORL_LINE_STYLE "QFrame{background: rgba(0,0,0,0.1);}"
|
||||
#define DARK_LINE_STYLE "QFrame{background: rgba(255, 255, 255, 0.16);}"
|
||||
|
||||
using namespace Zeeker;
|
||||
SeparationLine::SeparationLine(QWidget *parent) : QFrame(parent)
|
||||
{
|
||||
this->setLineWidth(0);
|
||||
this->setFixedHeight(1);
|
||||
setLineStyle();
|
||||
connect(qApp, &QApplication::paletteChanged, this, &SeparationLine::setLineStyle);
|
||||
}
|
||||
|
||||
void SeparationLine::setLineStyle()
|
||||
{
|
||||
QString type = GlobalSettings::getInstance()->getValue(STYLE_NAME_KEY).toString();
|
||||
if (type == "ukui-dark") {
|
||||
this->setStyleSheet(DARK_LINE_STYLE);
|
||||
} else {
|
||||
this->setStyleSheet(NOMORL_LINE_STYLE);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
#ifndef SEPARATIONLINE_H
|
||||
#define SEPARATIONLINE_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QFrame>
|
||||
|
||||
class SeparationLine : public QFrame
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
SeparationLine(QWidget *parent = nullptr);
|
||||
~SeparationLine() = default;
|
||||
public Q_SLOTS:
|
||||
void setLineStyle();
|
||||
};
|
||||
|
||||
#endif // SEPARATIONLINE_H
|
|
@ -111,10 +111,7 @@ void SettingsSearchPlugin::initDetailPage()
|
|||
m_nameFrameLyt->addStretch();
|
||||
m_nameFrameLyt->addWidget(m_pluginLabel);
|
||||
|
||||
m_line_1 = new QFrame(m_detailPage);
|
||||
m_line_1->setLineWidth(0);
|
||||
m_line_1->setFixedHeight(1);
|
||||
m_line_1->setStyleSheet("QFrame{background: rgba(0,0,0,0.2);}");
|
||||
m_line_1 = new SeparationLine(m_detailPage);
|
||||
|
||||
m_actionFrame = new QFrame(m_detailPage);
|
||||
m_actionFrameLyt = new QVBoxLayout(m_actionFrame);
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#include <QAction>
|
||||
#include <QDomDocument>
|
||||
#include "action-label.h"
|
||||
#include "separation-line.h"
|
||||
#include "search-plugin-iface.h"
|
||||
|
||||
namespace UkuiSearch {
|
||||
|
@ -52,7 +53,7 @@ private:
|
|||
QHBoxLayout *m_nameFrameLyt = nullptr;
|
||||
QLabel *m_nameLabel = nullptr;
|
||||
QLabel *m_pluginLabel = nullptr;
|
||||
QFrame *m_line_1 = nullptr;
|
||||
SeparationLine *m_line_1 = nullptr;
|
||||
QFrame *m_actionFrame = nullptr;
|
||||
QVBoxLayout *m_actionFrameLyt = nullptr;
|
||||
ActionLabel *m_actionLabel1 = nullptr;
|
||||
|
|
Loading…
Reference in New Issue