From eef4a621b330e4c331649b103f0a38d680857301 Mon Sep 17 00:00:00 2001 From: Matt Lowe Date: Sun, 9 Nov 2014 12:04:09 +0100 Subject: [PATCH] Updated Search Bar Style Please note that I don't feel that the search bar needs to be skinned by users, hence why it is not part of the large css-skinning project. I also feel that given the PR #416 a new search bar with highlight the new search functionality. Updated the look of the search bar: + larger, curved edges + changes color when has focus + search icon built into search - removed "Search For" text in lieu of search icon --- cockatrice/cockatrice.qrc | 1 + cockatrice/resources/icon_search_black.svg | 198 +++++++++++++++++++++ cockatrice/src/tab_deck_editor.cpp | 7 +- cockatrice/src/tab_deck_editor.h | 1 - 4 files changed, 202 insertions(+), 5 deletions(-) create mode 100644 cockatrice/resources/icon_search_black.svg diff --git a/cockatrice/cockatrice.qrc b/cockatrice/cockatrice.qrc index b4d2f05e..34aacb68 100644 --- a/cockatrice/cockatrice.qrc +++ b/cockatrice/cockatrice.qrc @@ -25,6 +25,7 @@ resources/hand.svg resources/pencil.svg resources/icon_search.svg + resources/icon_search_black.svg resources/icon_clearsearch.svg resources/icon_update.png resources/icon_view.svg diff --git a/cockatrice/resources/icon_search_black.svg b/cockatrice/resources/icon_search_black.svg new file mode 100644 index 00000000..05439a12 --- /dev/null +++ b/cockatrice/resources/icon_search_black.svg @@ -0,0 +1,198 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + \ No newline at end of file diff --git a/cockatrice/src/tab_deck_editor.cpp b/cockatrice/src/tab_deck_editor.cpp index 82a356d1..8c4e9e8e 100644 --- a/cockatrice/src/tab_deck_editor.cpp +++ b/cockatrice/src/tab_deck_editor.cpp @@ -51,9 +51,10 @@ TabDeckEditor::TabDeckEditor(TabSupervisor *_tabSupervisor, QWidget *parent) aClearSearch->setIcon(QIcon(":/resources/icon_clearsearch.svg")); connect(aClearSearch, SIGNAL(triggered()), this, SLOT(actClearSearch())); - searchLabel = new QLabel(); searchEdit = new SearchLineEdit; - searchLabel->setBuddy(searchEdit); + searchEdit->addAction(QIcon(":/resources/icon_search_black.svg"), QLineEdit::LeadingPosition); + searchEdit->setObjectName("searchEdit"); + searchEdit->setStyleSheet("#searchEdit{background:#DFE0E5;border-radius:13px;padding:5px 0px;}#searchEdit:focus{background:#EBEBEB;}"); setFocusProxy(searchEdit); setFocusPolicy(Qt::ClickFocus); @@ -73,7 +74,6 @@ TabDeckEditor::TabDeckEditor(TabSupervisor *_tabSupervisor, QWidget *parent) QHBoxLayout *searchLayout = new QHBoxLayout; searchLayout->addWidget(deckEditToolBar); - searchLayout->addWidget(searchLabel); searchLayout->addWidget(searchEdit); databaseModel = new CardDatabaseModel(db, this); @@ -293,7 +293,6 @@ void TabDeckEditor::retranslateUi() { aCardTextOnly->setText(tr("Show card text only")); aClearSearch->setText(tr("&Clear search")); - searchLabel->setText(tr("&Search for:")); nameLabel->setText(tr("Deck &name:")); commentsLabel->setText(tr("&Comments:")); diff --git a/cockatrice/src/tab_deck_editor.h b/cockatrice/src/tab_deck_editor.h index dd3b56ac..8db00e73 100644 --- a/cockatrice/src/tab_deck_editor.h +++ b/cockatrice/src/tab_deck_editor.h @@ -85,7 +85,6 @@ private: QTreeView *deckView; KeySignals deckViewKeySignals; CardFrame *cardInfo; - QLabel *searchLabel; SearchLineEdit *searchEdit; KeySignals searchKeySignals;