0
0
mirror of https://github.com/yse/easy_profiler.git synced 2024-12-27 16:51:22 +08:00

#0 [UI] Arbitrary value ToolTip styling fix; Viewport info fix;

This commit is contained in:
Victor Zarubkin 2018-04-02 01:50:53 +03:00
parent cb8e66e9ae
commit f736af9721
4 changed files with 49 additions and 24 deletions

View File

@ -63,8 +63,11 @@ ArbitraryValueToolTip::ArbitraryValueToolTip(const QString& _name
, const profiler::BlocksTree& _block, QWidget* _parent) , const profiler::BlocksTree& _block, QWidget* _parent)
: QWidget(_parent, Qt::ToolTip | Qt::WindowStaysOnTopHint) : QWidget(_parent, Qt::ToolTip | Qt::WindowStaysOnTopHint)
{ {
auto layout = new QVBoxLayout(this); auto content = new QWidget();
//layout->setContentsMargins(1, 1, 1, 1); content->setObjectName("cnt");
auto layout = new QVBoxLayout(content);
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(0); layout->setSpacing(0);
auto pane = new QTextEdit(); auto pane = new QTextEdit();
@ -137,6 +140,10 @@ ArbitraryValueToolTip::ArbitraryValueToolTip(const QString& _name
pane->setMaximumHeight((fm.height() + fm.leading() + 1) * rowsCount); pane->setMaximumHeight((fm.height() + fm.leading() + 1) * rowsCount);
setMaximumHeight(pane->maximumHeight() + fm2.height() + fm2.leading() + 10); setMaximumHeight(pane->maximumHeight() + fm2.height() + fm2.leading() + 10);
auto l = new QVBoxLayout(this);
l->setContentsMargins(0, 0, 0, 0);
l->addWidget(content);
} }
ArbitraryValueToolTip::~ArbitraryValueToolTip() ArbitraryValueToolTip::~ArbitraryValueToolTip()

View File

@ -1266,7 +1266,7 @@ void MainWindow::onViewportInfoClicked(bool)
{ {
const auto& size = EASY_GLOBALS.size; const auto& size = EASY_GLOBALS.size;
auto contents = QString("Device pixel ratio = %1\nFont height = %2px\nFont line spacing = %2px\nDiagram row = %3px\nDiagram spacing = %4px\nIcon size = %5x%5 px") auto contents = QString("Device pixel ratio = %1\nFont height = %2px\nFont line spacing = %3px\nDiagram row = %4px\nDiagram spacing = %5px\nIcon size = %6x%6 px")
.arg(size.pixelRatio).arg(size.font_height).arg(size.font_line_spacing) .arg(size.pixelRatio).arg(size.font_height).arg(size.font_line_spacing)
.arg(size.graphics_row_height).arg(size.threads_row_spacing).arg(size.icon_size); .arg(size.graphics_row_height).arg(size.threads_row_spacing).arg(size.icon_size);

View File

@ -25,12 +25,17 @@ MainWindow, QToolBar, QDialog {
QToolTip { QToolTip {
background-color: #ffeccc; background-color: #ffeccc;
border: 1px solid #cccccc; border: 1px solid #c4c4c4;
color: #504040; } color: #504040; }
ArbitraryValueToolTip { ArbitraryValueToolTip {
border: 1px solid #cccccc; margin: 0;
border: none;
background-color: #ffeccc; } background-color: #ffeccc; }
ArbitraryValueToolTip QWidget#cnt {
border: 1px solid #c4c4c4;
background-color: transparent;
margin: 0; }
ArbitraryValueToolTip QLabel { ArbitraryValueToolTip QLabel {
background-color: transparent; background-color: transparent;
border: none; border: none;
@ -44,10 +49,10 @@ ArbitraryValueToolTip {
QWidget#DiagramPopup, QWidget#ThreadsPopup { QWidget#DiagramPopup, QWidget#ThreadsPopup {
background-color: #ffeccc; background-color: #ffeccc;
border: 1px solid #cccccc; } border: 1px solid #c4c4c4; }
QGraphicsView { QGraphicsView {
border: 1px solid #cccccc; } border: 1px solid #c4c4c4; }
QSplitter::handle:hover { QSplitter::handle:hover {
background-color: rgba(244, 67, 54, 0.5); } background-color: rgba(244, 67, 54, 0.5); }
@ -58,7 +63,7 @@ QSplitter::handle:pressed {
/* ****************************************************************************************************************** */ /* ****************************************************************************************************************** */
QLineEdit, QComboBox, QSpinBox { QLineEdit, QComboBox, QSpinBox {
height: 24px; height: 24px;
border: 1px solid #cccccc; border: 1px solid #c4c4c4;
background-color: white; background-color: white;
selection-background-color: rgba(152, 222, 152, 0.5); selection-background-color: rgba(152, 222, 152, 0.5);
selection-color: #504040; } selection-color: #504040; }
@ -97,18 +102,21 @@ QSpinBox::up-button {
subcontrol-position: top right; subcontrol-position: top right;
margin-left: 5px; margin-left: 5px;
width: 24px; width: 24px;
border-left: 1px solid #cccccc; border-left: 1px solid #c4c4c4;
border-bottom: 1px solid #cccccc; } border-bottom: 1px solid #c4c4c4; }
QSpinBox::down-button { QSpinBox::down-button {
subcontrol-origin: padding; subcontrol-origin: padding;
subcontrol-position: bottom right; subcontrol-position: bottom right;
margin-left: 5px; margin-left: 5px;
width: 24px; width: 24px;
border-left: 1px solid #cccccc; } border-left: 1px solid #c4c4c4; }
QSpinBox::up-button:pressed, QSpinBox::down-button:pressed { QSpinBox::up-button:pressed, QSpinBox::down-button:pressed {
background-color: #f4f4f4; } background-color: #eaeaea; }
QSpinBox::up-button:!pressed:hover, QSpinBox::down-button:!pressed:hover {
background-color: #fafafa; }
QSpinBox::up-arrow { QSpinBox::up-arrow {
image: url(":/images/default/arrow-up"); image: url(":/images/default/arrow-up");
@ -136,7 +144,7 @@ QSpinBox::down-arrow:disabled {
QPushButton { QPushButton {
height: 24px; height: 24px;
min-width: 50px; min-width: 50px;
border: 1px solid #cccccc; border: 1px solid #c4c4c4;
background-color: white; background-color: white;
padding: 0 5px 0 5px; } padding: 0 5px 0 5px; }
@ -155,7 +163,7 @@ QPushButton:pressed {
/* ****************************************************************************************************************** */ /* ****************************************************************************************************************** */
QListView { QListView {
background-color: white; background-color: white;
border: 1px solid #cccccc; } border: 1px solid #c4c4c4; }
QListView, QTableView, QTreeView { QListView, QTableView, QTreeView {
alternate-background-color: #e4e4ec; alternate-background-color: #e4e4ec;
@ -164,7 +172,7 @@ QListView, QTableView, QTreeView {
QTreeView::branch { QTreeView::branch {
selection-background-color: rgba(152, 222, 152, 0.8); selection-background-color: rgba(152, 222, 152, 0.8);
border-bottom: 1px solid #cccccc; } border-bottom: 1px solid #c4c4c4; }
QTreeView::branch:selected { QTreeView::branch:selected {
background-color: rgba(152, 222, 152, 0.8); } background-color: rgba(152, 222, 152, 0.8); }
@ -181,7 +189,7 @@ QTreeView::branch:closed:has-children {
QListView::item, QTableView::item, QTreeView::item { QListView::item, QTableView::item, QTreeView::item {
height: 26px; height: 26px;
border-bottom: 1px solid #cccccc; } border-bottom: 1px solid #c4c4c4; }
QListView::item:selected, QTableView::item:selected, QTreeView::item:selected { QListView::item:selected, QTableView::item:selected, QTreeView::item:selected {
background-color: rgba(152, 222, 152, 0.8); } background-color: rgba(152, 222, 152, 0.8); }
@ -196,7 +204,7 @@ QTreeView::indicator {
QTreeView::indicator:hover, QTreeView::indicator:checked, QTreeView::indicator:indeterminate { QTreeView::indicator:hover, QTreeView::indicator:checked, QTreeView::indicator:indeterminate {
background-color: white; background-color: white;
border: 1px solid #cccccc; } border: 1px solid #c4c4c4; }
QTreeView::indicator:checked { QTreeView::indicator:checked {
image: url(":/images/default/check"); } image: url(":/images/default/check"); }
@ -213,7 +221,7 @@ QTreeView::indicator:indeterminate:disabled {
/* ****************************************************************************************************************** */ /* ****************************************************************************************************************** */
QMenu { QMenu {
background-color: white; background-color: white;
border: 1px solid #cccccc; border: 1px solid #c4c4c4;
padding-top: 4px; padding-top: 4px;
padding-bottom: 4px; } padding-bottom: 4px; }
@ -242,7 +250,7 @@ QMenu::icon:checked {
QMenu::separator { QMenu::separator {
height: 1px; height: 1px;
background: #cccccc; background: #c4c4c4;
margin-left: 5px; margin-left: 5px;
margin-right: 5px; } margin-right: 5px; }
@ -250,7 +258,7 @@ QMenu::indicator {
width: 14px; width: 14px;
height: 14px; height: 14px;
background-color: white; background-color: white;
border: 1px solid #cccccc; border: 1px solid #c4c4c4;
margin-left: 2px; margin-left: 2px;
padding: 1px; } padding: 1px; }
@ -347,7 +355,7 @@ DockWidget QWidget#EasyDockWidgetTitle {
QProgressBar { QProgressBar {
height: 24px; height: 24px;
background-color: white; background-color: white;
border: 1px solid #cccccc; border: 1px solid #c4c4c4;
color: #0B530B; color: #0B530B;
text-align: center; } text-align: center; }

View File

@ -17,7 +17,7 @@
/* Constants */ /* Constants */
$TextColor: #504040; $TextColor: #504040;
$DisabledTextColor: #a08888; $DisabledTextColor: #a08888;
$BorderColor: #cccccc; $BorderColor: #c4c4c4;
$MainColor: #f44336; $MainColor: #f44336;
$HoveredMenuRowColor: rgb_a(#98DE98, 0.5); $HoveredMenuRowColor: rgb_a(#98DE98, 0.5);
$BackgroundColor: white; $BackgroundColor: white;
@ -54,8 +54,14 @@ QToolTip {
} }
ArbitraryValueToolTip { ArbitraryValueToolTip {
border: 1px solid $BorderColor; margin: 0;
border: none;
background-color: $TooltipColor; background-color: $TooltipColor;
QWidget#cnt {
border: 1px solid $BorderColor;
background-color: transparent;
margin: 0;
}
QLabel { QLabel {
background-color: transparent; background-color: transparent;
border: none; border: none;
@ -137,7 +143,11 @@ QSpinBox::down-button {
} }
QSpinBox::up-button:pressed, QSpinBox::down-button:pressed { QSpinBox::up-button:pressed, QSpinBox::down-button:pressed {
background-color: #f4f4f4; background-color: #eaeaea;
}
QSpinBox::up-button:!pressed:hover, QSpinBox::down-button:!pressed:hover {
background-color: #fafafa;
} }
QSpinBox::up-arrow { image: url(":/images/default/arrow-up"); height: $SpinBoxArrowSize; width: $SpinBoxArrowSize; } QSpinBox::up-arrow { image: url(":/images/default/arrow-up"); height: $SpinBoxArrowSize; width: $SpinBoxArrowSize; }