diff --git a/resources/css/_contentManager.css b/resources/css/_contentManager.css index 642eae7..6026c3f 100644 --- a/resources/css/_contentManager.css +++ b/resources/css/_contentManager.css @@ -13,6 +13,11 @@ html, body { *:focus { outline: none; } + +#searchBar { + padding: 10px; +} + #searchInput { background-image: url('qrc:///icons/search.svg'); background-repeat: no-repeat; diff --git a/resources/css/popup.css b/resources/css/popup.css new file mode 100644 index 0000000..f1d5a97 --- /dev/null +++ b/resources/css/popup.css @@ -0,0 +1,14 @@ +QWidget { + background-color: white; + border: none; +} + +QScrollBar { + width: 5px; + border: none; + outline: none; +} + +QScrollBar::handle { + background-color: grey; +} \ No newline at end of file diff --git a/resources/css/style.css b/resources/css/style.css index 73fdaf4..3eb147e 100644 --- a/resources/css/style.css +++ b/resources/css/style.css @@ -11,9 +11,9 @@ TopWidget { min-height: 48px; max-height: 48px; margin: 0px; - padding: 0px; + padding: 5px; border: none; - border-bottom: 2px solid #ccc; + border-bottom: 1px solid #ccc; } TopWidget::separator { @@ -32,12 +32,12 @@ QToolButton { SearchBar { background-color: white; padding: 2px 2px 2px 40px; - max-height: 40px; - margin: 5px; + max-height: 38px; + margin-bottom: 2px; color: #666; font-size: 16px; - border: 2px solid #ccc; - border-radius: 5px; + border: 1px solid #ccc; + border-radius: 3px; } SearchBar > QPushButton { diff --git a/resources/style.qrc b/resources/style.qrc index b459a57..e10c8f6 100644 --- a/resources/style.qrc +++ b/resources/style.qrc @@ -1,5 +1,6 @@ css/style.css + css/popup.css diff --git a/src/searchbar.cpp b/src/searchbar.cpp index 0bfbf81..34fdacc 100644 --- a/src/searchbar.cpp +++ b/src/searchbar.cpp @@ -64,6 +64,14 @@ SearchBar::SearchBar(QWidget *parent) : m_completer.setCompletionMode(QCompleter::UnfilteredPopupCompletion); m_completer.setCaseSensitivity(Qt::CaseInsensitive); setCompleter(&m_completer); + + QFile styleFile(":/css/popup.css"); + styleFile.open(QIODevice::ReadOnly); + auto byteContent = styleFile.readAll(); + styleFile.close(); + QString style(byteContent); + m_completer.popup()->setStyleSheet(style); + connect(this, &QLineEdit::textEdited, this, &SearchBar::updateCompletion); connect(&m_completer, QOverload::of(&QCompleter::activated), this, &SearchBar::openCompletion);