From de475ee46cafd67d4ffea57e680d81309445b020 Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Thu, 10 Apr 2014 12:19:27 -0700 Subject: [PATCH] Update behavior of chat window close button Use a stylesheet to suppress highlighting of the background when pressing the button down. Instead, it will change the image. Unfortunately I wasn't able to find a way to do this without requiring an extra image, or by doing it through the icon system. The different icon states didn't seem to take effect for button presses, and using opacity in the stylesheet doesn't work yet for `QPushButton`s. --- interface/resources/images/close_down.svg | 79 +++++++++++++++++++++++ interface/resources/resources.qrc | 13 ++-- interface/ui/chatWindow.ui | 18 ++++-- 3 files changed, 100 insertions(+), 10 deletions(-) create mode 100644 interface/resources/images/close_down.svg diff --git a/interface/resources/images/close_down.svg b/interface/resources/images/close_down.svg new file mode 100644 index 0000000000..f36865fff1 --- /dev/null +++ b/interface/resources/images/close_down.svg @@ -0,0 +1,79 @@ + + + + + + image/svg+xml + + Slice 1 + + + + + Slice 1 + Created with Sketch (http://www.bohemiancoding.com/sketch) + + + + + + + + diff --git a/interface/resources/resources.qrc b/interface/resources/resources.qrc index 35c0e40270..bc41f41784 100644 --- a/interface/resources/resources.qrc +++ b/interface/resources/resources.qrc @@ -1,8 +1,9 @@ - - images/close.svg - images/kill-script.svg - images/reload.svg - images/stop.svg - + + images/close_down.svg + images/close.svg + images/kill-script.svg + images/reload.svg + images/stop.svg + diff --git a/interface/ui/chatWindow.ui b/interface/ui/chatWindow.ui index 60a0c6badd..095a2ba8f9 100644 --- a/interface/ui/chatWindow.ui +++ b/interface/ui/chatWindow.ui @@ -96,13 +96,23 @@ Qt::NoFocus + + QPushButton { + background-color: rgba( 0, 0, 0, 0% ); + border: none; + image: url(:images/close.svg) +} + + +QPushButton:pressed { + background-color: rgba( 0, 0, 0, 0% ); + border: none; + image: url(:images/close_down.svg) +} + - - - :/images/close.svg:/images/close.svg - true