Commit 881f4e60 authored by Thomas Hartmann's avatar Thomas Hartmann

QmlDesigner: Fix styling

We removed the images and broke the styling.
This patch removes most of the .css styling and uses the fusion
style instead.

Change-Id: Ib16a2cdbb4f63ec43065c91d6f37183044618139
Reviewed-by: default avatarTim Jenssen <tim.jenssen@theqtcompany.com>
parent ad2b968e
QPushButton, QComboBox[editable="false"],
QComboBox[editable="true"] {
border-image: url(:/qmldesigner/images/combobox-normal.png) 4;
background-color: creatorTheme.QmlDesignerBackgroundColorDarkAlternate;
border-width: 3;
font-size: 11px;
}
QPushButton:hover, QComboBox[editable="false"]:hover,
QComboBox[editable="true"]:hover, QMenuBar::item:hover {
border-image: url(:/qmldesigner/images/combobox-normal.png) 4;
background-color: creatorTheme.QmlDesignerBackgroundColorDarkAlternate;
border-width: 3;
}
QPushButton:pressed, QComboBox[editable="false"]:on,
QComboBox[editable="true"]:on, QMenuBar::item:on {
border-image: url(:/qmldesigner/images/combobox-pressed.png) 4;
background-color: creatorTheme.QmlDesignerBackgroundColorDarkAlternate;
border-width: 3;
}
......
......@@ -38,6 +38,7 @@
#include <utils/fileutils.h>
#include <QToolButton>
#include <QStyleFactory>
namespace QmlDesigner {
......@@ -51,6 +52,9 @@ ConnectionViewWidget::ConnectionViewWidget(QWidget *parent) :
setWindowTitle(tr("Connections", "Title of connection view"));
ui->setupUi(this);
QStyle *style = QStyleFactory::create("fusion");
setStyle(style);
setStyleSheet(Theming::replaceCssColors(QLatin1String(Utils::FileReader::fetchQrc(QLatin1String(":/connectionview/stylesheet.css")))));
//ui->tabWidget->tabBar()->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
......
......@@ -57,11 +57,8 @@ QStringList prependOnForSignalHandler(const QStringList &signalNames)
PropertiesComboBox::PropertiesComboBox(QWidget *parent) : QComboBox(parent)
{
static QScopedPointer<QStyle> style(QStyleFactory::create(QLatin1String("windows")));
setEditable(true);
setValidator(new QRegularExpressionValidator(QRegularExpression(QLatin1String("[a-z|A-Z|0-9|._-]*")), this));
if (style)
setStyle(style.data());
}
QString PropertiesComboBox::text() const
......@@ -195,12 +192,6 @@ QWidget *DynamicPropertiesDelegate::createEditor(QWidget *parent, const QStyleOp
{
QWidget *widget = QStyledItemDelegate::createEditor(parent, option, index);
if (widget) {
static QScopedPointer<QStyle> style(QStyleFactory::create(QLatin1String("windows")));
if (style)
widget->setStyle(style.data());
}
const DynamicPropertiesModel *model = qobject_cast<const DynamicPropertiesModel*>(index.model());
model->connectionView()->allModelNodes();
......
QFrame
{
background-color: creatorTheme.QmlDesignerBackgroundColorDarkAlternate;
color: creatorTheme.PanelTextColorLight;
font-size: 11px;
border-radius: 0px;
}
QPushButton {
padding: 0px;
font-size: 11px;
color: #dedede;
}
QPushButton, QComboBox[editable="false"],
QComboBox[editable="true"] {
border-image: url(:/qmldesigner/images/combobox-normal.png) 4;
border-width: 3;
font-size: 11px;
}
QPushButton:hover, QComboBox[editable="false"]:hover,
QComboBox[editable="true"]:hover, QMenuBar::item:hover {
border-image: url(:/qmldesigner/images/combobox-normal.png) 4;
border-width: 3;
}
QPushButton:pressed, QComboBox[editable="false"]:on,
QComboBox[editable="true"]:on, QMenuBar::item:on {
border-image: url(:/qmldesigner/images/combobox-pressed.png) 4;
border-width: 3;
}
QComboBox
{
font-size: 11px;
color: white;
min-width: 60px;
}
QComboBox[editable="true"] {
padding-right: 10px;
}
QComboBox[editable="true"]::drop-down {
subcontrol-origin: border;
subcontrol-position: top right;
width: 13px;
position: absolute;
top: 2px;
bottom: 2px;
right: 2px;
}
QComboBox[editable="true"]::drop-down,
QComboBox[editable="true"]::drop-down:hover,
QComboBox[editable="true"]::drop-down:on {
border-width: 0px;
border-left-width: 3px;
}
QComboBox[editable="true"]::down-arrow:on {
position: relative;
top: 1px;
left: 1px;
}
QComboBox::disabled {
color: gray;
}
QComboBox QAbstractItemView {
show-decoration-selected: 1;
background-color: #494949;
border: 1px solid black;
margin: 0px; /* some spacing around the menu */
color: #cacaca;
selection-background-color: #d2d2d2;
selection-color: #404040;
}
QTableView {
color: creatorTheme.PanelTextColorLight;
}
......@@ -146,12 +74,6 @@ QTabBar::tab {
color: creatorTheme.QmlDesignerTabLight;
}
QComboBox::menu-indicator, QComboBox::down-arrow {
image: url(:/qmldesigner/images/down_arrow.png);
width: 7px;
height: 7px;
}
QSpinBox
{
font-size: 11px;
......@@ -183,118 +105,6 @@ QSpinBox
min-height: 22px;
}
QSpinBox::down-button {
subcontrol-origin: border;
subcontrol-position: bottom right;
border-image: url(:/qmldesigner/images/spindown.png) 1;
width: 16px;
border-width: 1px;
border-top-width: 0;
}
QSpinBox::down-button:hover {
border-image: url(:/qmldesigner/images/spindown_hover.png) 1;
}
QSpinBox::down-button:pressed {
border-image: url(:/qmldesigner/images/spindown_pressed.png) 1;
}
QSpinBox::up-button {
subcontrol-origin: border;
subcontrol-position: top right; /* position at bottom right corner */
border-image: url(:/qmldesigner/images/spinup.png) 1;
width: 16px;
border-width: 1px;
}
QSpinBox::up-button:hover {
border-image: url(:/qmldesigner/images/spinup_hover.png) 1;
}
QSpinBox::up-button:pressed {
border-image: url(:/qmldesigner/images/spinup_pressed.png) 1;
}
QDoubleSpinBox::down-button {
subcontrol-origin: border;
subcontrol-position: bottom right;
border-image: url(:/qmldesigner/images/spindown.png) 1;
width: 16px;
border-width: 1px;
}
QDoubleSpinBox::down-button:hover {
border-image: url(:/qmldesigner/images/spindown_hover.png) 1;
}
QDoubleSpinBox::down-button:pressed {
border-image: url(:/qmldesigner/images/spindown_pressed.png) 1;
}
QDoubleSpinBox::up-button {
subcontrol-origin: border;
subcontrol-position: top right;
border-image: url(:/qmldesigner/images/spinup.png) 1;
width: 16px;
border-width: 1px;
}
QDoubleSpinBox::up-button:hover {
border-image: url(:/qmldesigner/images/spinup_hover.png) 1;
}
QDoubleSpinBox::up-button:pressed {
border-image: url(:/qmldesigner/images/spinup_pressed.png) 1;
}
QComboBox[editable="false"]::drop-down {
subcontrol-origin: padding;
subcontrol-position: top right;
width: 12px;
border-left-style: solid;
border-left-color: black;
border-left-width: 0px;
}
QComboBox[editable="false"]::down-arrow {
subcontrol-origin: content;
subcontrol-position: center;
position: relative;
right: 3px;
}
QComboBox[editable="false"]::down-arrow:on {
position: relative;
top: 1px;
}
QSpinBox::down-arrow, QSpinBox::menu-indicator, QDoubleSpinBox::down-arrow, QDoubleSpinBox::menu-indicator , QComboBox::menu-indicator, QComboBox::down-arrow {
image: url(:/qmldesigner/images/down_arrow.png);
width: 7px;
height: 7px;
}
QSpinBox::down-arrow:disabled, QSpinBox::down-arrow:off, QDoubleSpinBox::down-arrow:disabled, QDoubleSpinBox::down-arrow:off {
image: url(:/qmldesigner/images/down_arrow_disabled.png);
}
QSpinBox::up-arrow, QDoubleSpinBox::up-arrow {
image: url(:/qmldesigner/images/up_arrow.png);
width: 7px;
height: 7px;
}
QSpinBox::up-arrow:disabled, QSpinBox::up-arrow:off, QDoubleSpinBox::up-arrow:disabled, QDoubleSpinBox::up-arrow:off {
image: url(:/qmldesigner/images/up_arrow_disabled.png);
}
QLineEdit
{
color: white;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment