Linux-Trace-Devel Archive on lore.kernel.org
 help / color / Atom feed
From: Mikhail Rudenko <mike.rudenko@gmail.com>
To: linux-trace-devel@vger.kernel.org
Cc: Steven Rostedt <srostedt@redhat.com>,
	"Yordan Karadzhov (VMware)" <y.karadz@gmail.com>,
	Mikhail Rudenko <mike.rudenko@gmail.com>
Subject: [PATCH 4/4] kernel-shark: Change KsDualMarker's inactive button style to default
Date: Fri, 11 Oct 2019 00:24:29 +0300
Message-ID: <20191010212429.469155-5-mike.rudenko@gmail.com> (raw)
In-Reply-To: <20191010212429.469155-1-mike.rudenko@gmail.com>

At present, the style of an "inactive" KsDualMarker toolbar button is
set to "system default background + rgb(70,70,70) text color". As a
result, on dark qt color schemes (e.g. Breeze Dark) inactive button
looks disabled ("gray on gray").

This patch addresses the issue by changing "inactive" button style to
system default. This makes the UI intuitive across different color
schemes.

QStateMachine::setGlobalRestorePolicy is used for reducing the
boilerplate of manually resetting button style when it becomes
"inactive".

Signed-off-by: Mikhail Rudenko <mike.rudenko@gmail.com>
---
 kernel-shark/src/KsDualMarker.cpp | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/kernel-shark/src/KsDualMarker.cpp b/kernel-shark/src/KsDualMarker.cpp
index 0070777..90c5373 100644
--- a/kernel-shark/src/KsDualMarker.cpp
+++ b/kernel-shark/src/KsDualMarker.cpp
@@ -171,20 +171,12 @@ KsDualMarkerSM::KsDualMarkerSM(QWidget *parent)
 				"styleSheet",
 				styleSheetA);

-	_stateA->assignProperty(&_buttonB,
-				"styleSheet",
-				"color : rgb(70, 70, 70)");
-
 	styleSheetB = "background : " +
 		      _markB._color.name() +
 		      "; color : white";

 	_stateB = new QState;
 	_stateB->setObjectName("B");
-	_stateB->assignProperty(&_buttonA,
-				"styleSheet",
-				"color : rgb(70, 70, 70)");
-
 	_stateB->assignProperty(&_buttonB,
 				"styleSheet",
 				styleSheetB);
@@ -223,6 +215,7 @@ KsDualMarkerSM::KsDualMarkerSM(QWidget *parent)
 	connect(&_buttonA,	&KsMarkerButton::deselect,
 		this,		&KsDualMarkerSM::deselectA);

+	_machine.setGlobalRestorePolicy(QState::RestoreProperties);
 	_machine.addState(_stateA);
 	_machine.addState(_stateB);
 	_machine.setInitialState(_stateA);
--
2.23.0

  parent reply index

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-10 21:24 [PATCH 0/4] Fix KernelShark appearance on dark color schemes Mikhail Rudenko
2019-10-10 21:24 ` [PATCH 1/4] kernel-shark: Set text color to black in KsDualMarker's QLabels Mikhail Rudenko
2019-10-10 21:24 ` [PATCH 2/4] kernel-shark: Set text color to black in pointer position QLabel Mikhail Rudenko
2019-10-10 21:24 ` [PATCH 3/4] kernel-shark: Set text color to black in KsTraceGraph's axes labels Mikhail Rudenko
2019-10-10 21:24 ` Mikhail Rudenko [this message]
2019-10-10 22:02 ` [PATCH 0/4] Fix KernelShark appearance on dark color schemes Steven Rostedt
2019-10-11 14:11   ` Yordan Karadzhov (VMware)
2019-10-11 18:18     ` Mikhail Rudenko

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191010212429.469155-5-mike.rudenko@gmail.com \
    --to=mike.rudenko@gmail.com \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=srostedt@redhat.com \
    --cc=y.karadz@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-Trace-Devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-trace-devel/0 linux-trace-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-trace-devel linux-trace-devel/ https://lore.kernel.org/linux-trace-devel \
		linux-trace-devel@vger.kernel.org linux-trace-devel@archiver.kernel.org
	public-inbox-index linux-trace-devel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-trace-devel


AGPL code for this site: git clone https://public-inbox.org/ public-inbox