0
0
mirror of https://github.com/yse/easy_profiler.git synced 2024-12-27 00:31:02 +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)
: QWidget(_parent, Qt::ToolTip | Qt::WindowStaysOnTopHint)
{
auto layout = new QVBoxLayout(this);
//layout->setContentsMargins(1, 1, 1, 1);
auto content = new QWidget();
content->setObjectName("cnt");
auto layout = new QVBoxLayout(content);
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(0);
auto pane = new QTextEdit();
@ -137,6 +140,10 @@ ArbitraryValueToolTip::ArbitraryValueToolTip(const QString& _name
pane->setMaximumHeight((fm.height() + fm.leading() + 1) * rowsCount);
setMaximumHeight(pane->maximumHeight() + fm2.height() + fm2.leading() + 10);
auto l = new QVBoxLayout(this);
l->setContentsMargins(0, 0, 0, 0);
l->addWidget(content);
}
ArbitraryValueToolTip::~ArbitraryValueToolTip()

View File

@ -1266,7 +1266,7 @@ void MainWindow::onViewportInfoClicked(bool)
{
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.graphics_row_height).arg(size.threads_row_spacing).arg(size.icon_size);

View File

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

View File

@ -17,7 +17,7 @@
/* Constants */
$TextColor: #504040;
$DisabledTextColor: #a08888;
$BorderColor: #cccccc;
$BorderColor: #c4c4c4;
$MainColor: #f44336;
$HoveredMenuRowColor: rgb_a(#98DE98, 0.5);
$BackgroundColor: white;
@ -54,8 +54,14 @@ QToolTip {
}
ArbitraryValueToolTip {
border: 1px solid $BorderColor;
margin: 0;
border: none;
background-color: $TooltipColor;
QWidget#cnt {
border: 1px solid $BorderColor;
background-color: transparent;
margin: 0;
}
QLabel {
background-color: transparent;
border: none;
@ -137,7 +143,11 @@ QSpinBox::down-button {
}
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; }