Remove most stylesheet use as this messes with a custom style

* Use palettes where a certain colour is needed.
* Still need some solution for table borders in grid layouts
This commit is contained in:
baldurk
2017-07-26 17:14:37 +01:00
parent a4e4c1fd5d
commit a6f0d07e09
11 changed files with 226 additions and 41 deletions
+1 -1
View File
@@ -188,7 +188,7 @@ QRect RDStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex *opt,
// return the normal rect if there's no menu
if(!(toolbutton->subControls & SC_ToolButtonMenu) &&
!(toolbutton->features & QStyleOptionToolButton::HasMenu))
!(toolbutton->features & QStyleOptionToolButton::MenuButtonPopup))
{
return ret;
}
@@ -132,7 +132,7 @@ void RDTweakedNativeStyle::drawComplexControl(ComplexControl control, const QSty
// draw the menu arrow, if there is one
if((toolbutton->subControls & SC_ToolButtonMenu) ||
(toolbutton->features & QStyleOptionToolButton::HasMenu))
(toolbutton->features & QStyleOptionToolButton::MenuButtonPopup))
{
QStyleOptionToolButton menu = *toolbutton;
menu.rect = subControlRect(control, opt, SC_ToolButtonMenu, widget);
+37 -3
View File
@@ -131,14 +131,48 @@ Vectors (e.g. float4), matrices ([row_major] half3x4) and arrays (float[16]) are
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="palette">
<palette>
<active>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>170</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>170</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>106</red>
<green>104</green>
<blue>100</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="font">
<font>
<pointsize>14</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(171, 32, 32);</string>
</property>
</widget>
</item>
</layout>
+100 -5
View File
@@ -31,8 +31,99 @@
</property>
<item>
<widget class="QFrame" name="frame">
<property name="styleSheet">
<string notr="true">background-color: #3bb779;</string>
<property name="palette">
<palette>
<active>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>59</red>
<green>183</green>
<blue>121</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>59</red>
<green>183</green>
<blue>121</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>106</red>
<green>104</green>
<blue>100</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>59</red>
<green>183</green>
<blue>121</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>59</red>
<green>183</green>
<blue>121</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="autoFillBackground">
<bool>true</bool>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="leftMargin">
@@ -43,14 +134,18 @@
</property>
<item>
<widget class="QLabel" name="rdocName">
<property name="palette">
<palette>
<active/>
<inactive/>
<disabled/>
</palette>
</property>
<property name="font">
<font>
<pointsize>36</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: #fff;</string>
</property>
<property name="text">
<string>RenderDoc</string>
</property>
@@ -160,10 +160,6 @@ LiveCapture::LiveCapture(ICaptureContext &ctx, const QString &hostname, const QS
QObject::connect(ui->captures, &RDListWidget::keyPress, this, &LiveCapture::captures_keyPress);
ui->mainLayout->addWidget(bottomTools);
bottomTools->setStyleSheet(
lit("background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,"
"stop: 0 #E1E1E1, stop: 1.0 #D3D3D3);"));
}
}
-12
View File
@@ -63,9 +63,6 @@
<pointsize>9</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="title">
<string>Tip #X</string>
</property>
@@ -91,9 +88,6 @@
<pointsize>16</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string>Tip #X: Tip Title</string>
</property>
@@ -123,9 +117,6 @@
<pointsize>12</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string>TextLabel</string>
</property>
@@ -158,9 +149,6 @@
<pointsize>10</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string>https://renderdoc.org/tips/1</string>
</property>
+10 -7
View File
@@ -156,6 +156,9 @@ EventBrowser::EventBrowser(ICaptureContext &ctx, QWidget *parent)
OnLogfileClosed();
m_redPalette = palette();
m_redPalette.setColor(QPalette::Base, Qt::red);
m_Ctx.AddLogViewer(this);
}
@@ -422,7 +425,7 @@ void EventBrowser::on_HideFindJump()
ui->jumpToEID->setText(QString());
ClearFindIcons();
ui->findEvent->setStyleSheet(QString());
ui->findEvent->setPalette(palette());
}
void EventBrowser::on_jumpToEID_returnPressed()
@@ -442,9 +445,9 @@ void EventBrowser::findHighlight_timeout()
int results = SetFindIcons(ui->findEvent->text());
if(results > 0)
ui->findEvent->setStyleSheet(QString());
ui->findEvent->setPalette(palette());
else
ui->findEvent->setStyleSheet(lit("QLineEdit{background-color:#ff0000;}"));
ui->findEvent->setPalette(m_redPalette);
}
void EventBrowser::on_findEvent_textEdited(const QString &arg1)
@@ -453,7 +456,7 @@ void EventBrowser::on_findEvent_textEdited(const QString &arg1)
{
m_FindHighlight->stop();
ui->findEvent->setStyleSheet(QString());
ui->findEvent->setPalette(palette());
ClearFindIcons();
}
else
@@ -1187,7 +1190,7 @@ void EventBrowser::Find(bool forward)
if(eid >= 0)
{
SelectEvent((uint32_t)eid);
ui->findEvent->setStyleSheet(QString());
ui->findEvent->setPalette(palette());
}
else // if(WrapSearch)
{
@@ -1195,11 +1198,11 @@ void EventBrowser::Find(bool forward)
if(eid >= 0)
{
SelectEvent((uint32_t)eid);
ui->findEvent->setStyleSheet(QString());
ui->findEvent->setPalette(palette());
}
else
{
ui->findEvent->setStyleSheet(lit("QLineEdit{background-color:#ff0000;}"));
ui->findEvent->setPalette(m_redPalette);
}
}
}
+2
View File
@@ -125,6 +125,8 @@ private:
void ExportDrawcall(QTextStream &writer, int maxNameLength, int indent, bool firstchild,
const DrawcallDescription &drawcall);
QPalette m_redPalette;
TimeUnit m_TimeUnit = TimeUnit::Count;
rdctype::array<CounterResult> m_Times;
-3
View File
@@ -109,7 +109,6 @@ MainWindow::MainWindow(ICaptureContext &ctx) : QMainWindow(NULL), ui(new Ui::Mai
contextChooser->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
contextChooser->setPopupMode(QToolButton::InstantPopup);
contextChooser->setMenu(contextChooserMenu);
contextChooser->setStyleSheet(lit("QToolButton::menu-indicator { image: none; }"));
contextChooser->setContextMenuPolicy(Qt::DefaultContextMenu);
QObject::connect(contextChooserMenu, &QMenu::aboutToShow, this,
&MainWindow::contextChooser_menuShowing);
@@ -158,8 +157,6 @@ MainWindow::MainWindow(ICaptureContext &ctx) : QMainWindow(NULL), ui(new Ui::Mai
});
m_RemoteProbe->start();
ui->statusBar->setStyleSheet(lit("QStatusBar::item { border: 0px }"));
SetTitle();
PopulateRecentFiles();
@@ -446,12 +446,48 @@
</item>
<item>
<widget class="QLabel" name="iaBytecodeMismatch">
<property name="palette">
<palette>
<active>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>170</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>170</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>106</red>
<green>104</green>
<blue>100</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="styleSheet">
<string notr="true">color: red;
border: 1px solid black;</string>
<property name="frameShape">
<enum>QFrame::Box</enum>
</property>
<property name="text">
<string>Mismatch of Input Layout and Vertex Shader signatures</string>
+36 -2
View File
@@ -40,8 +40,42 @@ Right click to debug an event, hide failed events, or jump to the modification's
</item>
<item>
<widget class="QLabel" name="eventsHidden">
<property name="styleSheet">
<string notr="true">color: #f00;</string>
<property name="palette">
<palette>
<active>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>200</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>200</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>106</red>
<green>104</green>
<blue>100</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="text">
<string>Failed events are currently hidden</string>