Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ajgappmark/47348a24ce22a69c5a8621f7d0216ac9 to your computer and use it in GitHub Desktop.
Save ajgappmark/47348a24ce22a69c5a8621f7d0216ac9 to your computer and use it in GitHub Desktop.
one dark theme for QtCreator
#start /home/serg/.config/QtProject/qtcreator/styles/onedark.xml
<?xml version="1.0" encoding="UTF-8"?>
<style-scheme version="1.0" name="onedark">
<style name="Text" foreground="#cecece" background="#282c34"/>
<style name="Link" foreground="#409090"/>
<style name="Selection" foreground="#ffffff" background="#4e4e8f"/>
<style name="LineNumber" foreground="#5c6370" background="#2f343f"/>
<style name="SearchResult" foreground="#000000" background="#2d4c95"/>
<style name="SearchScope" foreground="#000000" background="#f8fafc"/>
<style name="Parentheses" foreground="#ffff00" background="#4e4e8f"/>
<style name="ParenthesesMismatch" background="#404040"/>
<style name="AutoComplete" foreground="#ffff00" background="#4e4e8f"/>
<style name="CurrentLine" foreground="#000000" background="#2f343f"/>
<style name="CurrentLineNumber" foreground="#a7a7f5" background="#363a4f" bold="true"/>
<style name="Occurrences" foreground="#000000" background="#616161"/>
<style name="Occurrences.Unused" foreground="#6f672a" underlineStyle="SingleUnderline"/>
<style name="Occurrences.Rename" foreground="#000000" background="#ff6464"/>
<style name="Number" foreground="#d19a66"/>
<style name="String" foreground="#98c379"/>
<style name="Type" foreground="#8587e5"/>
<style name="Local"/>
<style name="Global"/>
<style name="Field" bold="true" italic="true"/>
<style name="Static" foreground="#8587e5"/>
<style name="VirtualMethod" italic="true"/>
<style name="Function" foreground="#61afef"/>
<style name="Keyword" foreground="#c678dd"/>
<style name="PrimitiveType" foreground="#e575a7"/>
<style name="Operator" foreground="#cfbfad"/>
<style name="Preprocessor" foreground="#409090"/>
<style name="Label" foreground="#e76000"/>
<style name="Comment" foreground="#5c6370"/>
<style name="Doxygen.Comment" foreground="#737dd5"/>
<style name="Doxygen.Tag" foreground="#4e5ab3"/>
<style name="VisualWhitespace" foreground="#646482"/>
<style name="QmlLocalId" italic="true"/>
<style name="QmlExternalId" foreground="#aaaaff" italic="true"/>
<style name="QmlTypeId" foreground="#ff8bff"/>
<style name="QmlRootObjectProperty" italic="true"/>
<style name="QmlScopeObjectProperty" italic="true"/>
<style name="QmlExternalObjectProperty" foreground="#aaaaff" italic="true"/>
<style name="JsScopeVar" foreground="#8888ff" italic="true"/>
<style name="JsImportVar" foreground="#8888ff" italic="true"/>
<style name="JsGlobalVar" foreground="#8888ff" italic="true"/>
<style name="QmlStateName" italic="true"/>
<style name="Binding" foreground="#ff5555"/>
<style name="DisabledCode" foreground="#a0a0a4" italic="true"/>
<style name="AddedLine" foreground="#00aa00"/>
<style name="RemovedLine" foreground="#ff0000"/>
<style name="DiffFile" foreground="#8484f3"/>
<style name="DiffLocation" foreground="#0084ff"/>
<style name="DiffFileLine" foreground="#404040" background="#dcb178"/>
<style name="DiffContextLine" foreground="#404040" background="#97bac7"/>
<style name="DiffSourceLine" background="#8c2d2d"/>
<style name="DiffSourceChar" background="#c34141"/>
<style name="DiffDestLine" background="#277027"/>
<style name="DiffDestChar" background="#339d33"/>
<style name="LogChangeLine" foreground="#dcdc00"/>
<style name="Warning" underlineColor="#ffbe00" underlineStyle="SingleUnderline"/>
<style name="WarningContext" underlineColor="#ffbe00" underlineStyle="DotLine"/>
<style name="Error" underlineColor="#ff0000" underlineStyle="SingleUnderline"/>
<style name="ErrorContext" underlineColor="#ff0000" underlineStyle="DotLine"/>
<style name="Declaration"/>
<style name="OutputArgument" foreground="#000000" background="#ffffff" italic="true"/>
<style name="LastStyleSentinel"/>
</style-scheme>
#end /home/serg/.config/QtProject/qtcreator/styles/onedark.xml
#start /home/serg/.config/QtProject/qtcreator/styles/onedark.css
/*
* TODO: Search buttons color (Replace, Replace and continue search)
*/
/*
* Drop background color of most widgets
*/
QWidget, QStackedWidget,
QScrollArea, QAbstractScrollArea {
background-color: transparent;
}
QApplication,
QMainWindow, QFrame, QDockWidget, QDialog, QFileDialog, QMessageBox,
QRadioButton,
QGroupBox::title, /* Need to set background becase must clear border behind label */
QMenuBar, QMenu, QMenu::item,
QComboBox QAbstractItemView,
QTreeView, QListWidget, QListView, QTableWidget, QTableView,
QTextEdit, QTextBrowser {
background-color: #2F343F; /*#004100;*/
color: #bbbbbb;
}
/*
* This is default values
* Edit first if you want change appearance
*/
QLabel, QTabBar::tab, QMenuBar::item,
QCheckBox, QGroupBox {
background-color: transparent;
color: #bbbbbb;
selection-color: #bbbbbb;
}
/*
* GroupBox and CheckBox
*
* TODO: ::indicator:indeterminate icons
*/
QGroupBox {
border-top: 1px solid #2d2d2d;
margin-top: 0.5em;
}
QGroupBox::title {
subcontrol-origin: margin;
subcontrol-position: top left;
padding: 0 3px;
}
QCheckBox::indicator,
QGroupBox::indicator {
width: 13px;
height: 13px;
}
QCheckBox::indicator:unchecked,
QGroupBox::indicator:unchecked {
image: url(:/qmldesigner/images/checkbox_unchecked.png);
}
QCheckBox::indicator:unchecked:hover,
QGroupBox::indicator:unchecked:hover {
image: url(:/qmldesigner/images/checkbox_unchecked_hover.png);
}
QCheckBox::indicator:unchecked:pressed,
QGroupBox::indicator:unchecked:pressed {
image: url(:/qmldesigner/images/checkbox_unchecked_pressed.png);
}
QCheckBox::indicator:checked,
QGroupBox::indicator:checked {
image: url(:/qmldesigner/images/checkbox_checked.png);
}
QCheckBox::indicator:checked:hover,
QGroupBox::indicator:checked:hover {
image: url(:/qmldesigner/images/checkbox_checked_hover.png);
}
QCheckBox::indicator:checked:pressed,
QGroupBox::indicator:checked:pressed {
image: url(:/qmldesigner/images/checkbox_checked_pressed.png);
}
QCheckBox::indicator:indeterminate:hover,
QGroupBox::indicator:indeterminate:hover {
background-color: #2222bb;
image: url(:/qmldesigner/images/checkbox_indeterminate_hover.png); /* TODO: There is no shuch image */
}
QCheckBox::indicator:indeterminate:pressed,
QGroupBox::indicator:indeterminate:pressed {
background-color: #22bb22;
image: url(:/qmldesigner/images/checkbox_indeterminate_pressed.png); /* TODO: There is no shuch image */
}
QLineEdit, QAbstractSpinBox, QComboBox, QPushButton {
background-color: #2F343F;
/*background-color: rgba(255, 255, 255, 0.05);*/
background-origin: border;
border: 1px solid #2F343F;
color: #bbbbbb;
min-width: 3em;
padding: 0px 1px 2px 3px;
selection-background-color: #4b6eaf;
}/*:focus
{
outline: 3px ridge #4e78a2;
border-radius: 2px;
}
:edit-focus
{
border: 1px solid red;
}*/
:read-only {
background-color: transparent;
border: 1px solid #535353;
color: #999999;
}
:no-frame {
border-width: 0;
}
/*
* Any SpinBox (e.g. DoubleSpinbox)
*
* TODO: Icons not fit into the overall style
*/
QAbstractSpinBox::up-button {
image: url(:/qmldesigner/images/spinup.png);
}
QAbstractSpinBox::up-button:hover {
image: url(:/qmldesigner/images/spinup_hover.png);
}
QAbstractSpinBox::up-button:off {
image: url(:/qmldesigner/images/spinup_off.png);
}
QAbstractSpinBox::up-button:pressed {
image: url(:/qmldesigner/images/spinup_pressed.png);
}
QAbstractSpinBox::down-button {
image: url(:/qmldesigner/images/spindown.png);
}
QAbstractSpinBox::down-button:hover {
image: url(:/qmldesigner/images/spindown_hover.png);
}
QAbstractSpinBox::down-button:off {
image: url(:/qmldesigner/images/spindown_off.png);
}
QAbstractSpinBox::down-button:pressed {
image: url(:/qmldesigner/images/spindown_pressed.png);
}
/*
* PushButton and Utils::QtColorButton
*
* TODO: Customize :pressed
* FIXME: Outline is positioned around content, but should around padding
*/
QPushButton {
min-height: 1.33em;
min-width: 5.25em;
outline: 0;
}
Utils--QtColorButton,
QPushButton {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #515658, stop: 1.0 #44494b);
border: 1px solid #5f6161;
border-radius: 2px;
}
Utils--QtColorButton:pressed,
QPushButton:pressed {
border-style: inset;
}
QPushButton:default {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #344a64, stop: 1.0 #263549);
}
Utils--QtColorButton:disabled,
QPushButton:disabled {
background-color: transparent;
color: #999999;
}
Utils--QtColorButton:open,
QPushButton:open {
background-color: #4b6eaf;
}
QPushButton::menu-indicator {
subcontrol-origin: content;
subcontrol-position: bottom right;
}
/*
* ComboBox
*/
QComboBox {
border-radius: 2px;
min-width: 3em;
padding: 0px 1px 2px 3px;
}
QComboBox:!editable {
/*background-color: rgba(63, 113, 73, 0.2);*/
/*background-color: #212733;*/
background-color: rgba(255, 255, 255, 0.05);
}
/*
QComboBox:!editable:on
QComboBox::drop-down:editable:on
QComboBox::drop-down:editable
*/
QComboBox:on {
padding-top: 3px;
padding-left: 4px;
}
QComboBox::down-arrow {
image: url(:/qmldesigner/images/triangle_vert.png);
}
QComboBox::down-arrow:on {
top: 1px;
left: 1px;
}
QComboBox::drop-down {
border-left: 1px solid #2F343F;
}
QComboBox QAbstractItemView {
border: 1px solid red;/*black;*/
/*selection-background-color: #d2d2d2;
selection-color: #404040;
show-decoration-selected: 1; /* make the selection span the entire width of the view */
}
/*
* RadioButton
*
* TODO: Checked circle is hard to spot
*/
QRadioButton::indicator {
width: 13px;
height: 13px;
}
QRadioButton::indicator:unchecked {
image: url(:/qmldesigner/images/radiobutton_unchecked.png);
}
QRadioButton::indicator:unchecked:hover {
image: url(:/qmldesigner/images/radiobutton_unchecked_hover.png);
}
QRadioButton::indicator:unchecked:pressed {
image: url(:/qmldesigner/images/radiobutton_unchecked_pressed.png);
}
QRadioButton::indicator:checked {
image: url(:/qmldesigner/images/radiobutton_checked.png);
}
QRadioButton::indicator:checked:hover {
image: url(:/qmldesigner/images/radiobutton_checked_hover.png);
}
QRadioButton::indicator:checked:pressed {
image: url(:/qmldesigner/images/radiobutton_checked_pressed.png);
}
/*
* TabWidget and TabBar
*
* FIXME: Designer bottom tabbar problem
* TODO: Customize QTabBar::tab:hover
*/
QTabWidget::tab-bar {
/*position: relative;
bottom: -1px;*/
}
QTabWidget::pane {
background-color: transparent;
border: 1px solid #323232;
}
QTabWidget::pane:top {
top: -1px;
}
QTabWidget::pane:right {
right: -1px;
}
QTabWidget::pane:bottom {
bottom: -1px;
}
QTabWidget::pane:left {
left: -1px;
}
QTabBar::tab {
border: 1px solid #292b2d;
min-width: 8ex;
padding: 4px;
}
/*QTabBar::tab:hover {
background-color: #4b6eaf;
}*/
QTabBar::tab:top {
border-top-left-radius: 4px;
border-top-right-radius: 4px;
}
QTabBar::tab:right {
border-top-right-radius: 4px;
border-bottom-right-radius: 4px;
}
QTabBar::tab:bottom {
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
}
QTabBar::tab:left {
border-top-left-radius: 4px;
border-bottom-left-radius: 4px;
}
QTabBar::tab:selected {
background-color: #41516d;
}
QTabBar::tab:top:selected {
border-bottom-color: #41516d;
}
QTabBar::tab:right:selected {
border-left-color: #41516d;
}
QTabBar::tab:bottom:selected {
border-top-color: #41516d;
}
QTabBar::tab:left:selected {
border-right-color: #41516d;
}
QTabBar::tab:top:!selected {
margin-top: 2px;
}
QTabBar::tab:right:!selected {
margin-right: 2px;
}
QTabBar::tab:bottom:!selected {
margin-bottom: 2px;
}
QTabBar::tab:left:!selected {
margin-left: 2px;
}
/*
* Table
*
* FIXME: Problem with arrows positioning workarounded in bad way
* FIXME: Unknown problem Options > FakeVim > User Command Mapping
* QT-BUG: Wrong behaviour property min-height of QHeaderView::section
*/
QTableWidget,
QTableView {
/* This rule have more priority than previous?!
* And overrides with empty if not declared! */
/*background: red; /*transparent;*/
/*color: #bbbbbb;*/
border: 1px solid #323232;
alternate-background-color: #2F343F; /* Dont work without setAlternatingRowColors(true) */
}
QTableView QTableCornerButton::section {
background-color: 2F343F; /*FIXME*/
border: 2px outset blue; /*FIXME*/
}
QHeaderView::section {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop:0 #54585b, stop:1 #2F343F);
color: #bbbbbb;
padding: 1px 2px 1px 4px;
border: 1px solid #323232;
border-top-width: 0;
border-left-color: #5e6163;
border-right-color: #2a2c2d;
/*min-height: 15px;*/
}
QHeaderView::section:hover {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop:0 #64686b, stop:1 #2F343F);
border-bottom-color: #424242;
}
QHeaderView::section:first {
border-left-width: 0;
}
QHeaderView::section:last {
border-right-width: 0;
}
QHeaderView::section:checked {
background-color: red; /*FIXME*/
}
QHeaderView::down-arrow {
image: url(:/qmldesigner/images/down_arrow.png);
right: 7px;
}
QHeaderView::up-arrow {
image: url(:/qmldesigner/images/up_arrow.png);
/* image-position: right; Don't work */
/*right: 7px; */
height: 7px;
width: 7px;
}
/*
* Menu and MenuBar
*
* TODO: Customize toggleable items
*/
QMenuBar {
/*background-color: #2F343F; /* transparent don't work */
border-bottom: 2px solid qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop:0 #2F343F, stop:1 #555555);
}
QMenuBar::item:pressed {
background-color: #4b6eaf;
}
QMenuBar::item:selected:!pressed {
background-color: #2F343F;
}
QMenu {
border: 1px solid #2d2d2d;
}
/*QMenu::item {
margin-left: 3px;
}*/
QMenu::item:disabled {
color: #999999;
}
QMenu::item:selected {
background-color: #4b6eaf;
}
QMenu::icon {
border: 0px solid transparent;
background-color: transparent;
}
QMenu::icon:checked {
background-color: blue;
border: 1px inset red;
position: absolute;
top: 1px;
right: 1px;
bottom: 1px;
left: 1px;
}
QMenu::separator {
height: 2px;
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop:0 #2F343F, stop:1 #2F343F);
margin: 0 1px;
}
/*QMenu::indicator {
width: 13px;
height: 13px;
background-color: blue;
}*/
/*
* Scroll bar modifications
*/
QScrollBar {
background-color: transparent;
margin: 0;
height: 12px; /* for horizontal */
width: 12px; /* for vertical */
}
QScrollBar::handle {
border: 1px solid #555555;
border-radius: 4px;
margin: 1px;
}
QScrollBar::handle:vertical {
background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0, stop:0 #5c5c5c, stop:1 #2F343F);
min-height: 20px;
min-width: 8px;
}
QScrollBar::handle:vertical:hover {
background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0, stop:0 #666666, stop:1 #2F343F);
}
QScrollBar::handle:horizontal {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop:0 #5c5c5c, stop:1 #2F343F);
min-height: 8px;
min-width: 20px;
}
QScrollBar::handle:horizontal:hover {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop:0 #666666, stop:1 #2F343F);
}
QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical,
QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal {
background-color: transparent;
}
/*QScrollBar::sub-page:vertical {
max-height: 8px;
margin-top: auto;
margin-bottom: 0;
background-color: purple;
border-top-left-radius: 4px;
border-top-right-radius: 4px;
}
QScrollBar::add-page:vertical {
max-height: 8px;
margin-top: 0;
margin-bottom: auto;
background-color: darkblue;
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
}*/
QScrollBar::add-line:vertical, QScrollBar::sub-line:vertical,
QScrollBar::add-line:horizontal, QScrollBar::sub-line:horizontal {
height: 0;
width: 0;
}
/*
* Status bar
*/
/*
QStatusBar {
background-color: brown;
border: 1px solid brown;
}
QStatusBar::item {
background-color: red;
border: 1px solid red;
border-radius: 3px;
}
QStatusBar QLabel {
background-color: green;
border: 3px solid green;
}
*/
/*
* QAbstractItemView modifications
*
* TODO: ::indicator
* TODO: Disable item icon selection mask
* FIXME: Transparent selection background on some elements Options > BlackBerry > API Levels and Runtimes
* QT-BUG: Strange behaviour of selection-* properties (always :!focus)
*/
QAbstractItemView {
border: 1px solid #2F343F;
selection-color: #bbbbbb;
selection-background-color: #4b6eaf;
alternate-background-color: #2F343F; /* Works only if setAlternatingRowColors(true) */
show-decoration-selected: 1;
outline: 0;
}
/*
QAbstractItemView:!focus {
selection-background-color: #0d293e;
}
QTreeView::branch,
QAbstractItemView::item {
border-width: 0;
}
*/
QAbstractItemView::item:alternate {
background-color: #2F343F;
}
QListWidgetItem,
QTreeWidgetItem {
background-color: red;
color: yellow;
border: 1px solid purple;
}
QAbstractItemView::text {
color: #bbbbbb;
}
QTreeView::branch:hover,
QAbstractItemView::item:hover {
background-color: rgba(255, 255, 255, 0.05);
}
QTreeView::branch:selected:active,
QAbstractItemView::item:selected {
background-color: #4b6eaf;
}
/* No way due to another bug :(
QTreeView::branch:selected:active,
QAbstractItemView::item:selected:active {
background-color: #4b6eaf;
}
QTreeView::branch:selected:!active,
QAbstractItemView::item:selected:!active {
background-color: #0d293e;
}
*/
QTreeView::branch:has-siblings:adjoins-item,
QTreeView::branch:has-siblings:!adjoins-item,
QTreeView::branch:!has-children:!has-siblings:adjoins-item {
border-image: none;
image: none;
}
QTreeView::branch:has-children:!has-siblings:closed,
QTreeView::branch:closed:has-children:has-siblings {
border-image: none;
image: url(:/qmldesigner/images/triangle_horz.png);
}
QTreeView::branch:open:has-children:!has-siblings,
QTreeView::branch:open:has-children:has-siblings {
border-image: none;
image: url(:/qmldesigner/images/triangle_vert.png);
}
/*
* Tool bar
*/
QToolBar {
border-width: 0; /* Cancels gradiend */
}
/*
* Resizing widget (bottom right in Qt Creator, inside status bar)
*/
QSizeGrip {
image: url(:/qmldesigner/images/sizegrip.png);
width: 16px;
height: 16px;
}
/*
* ToolTip
*/
QToolTip, QTipLabel {
border: 1px solid #9a9a66;
border-radius: 3px;
background: #2F343F;
color: #bbbbbb;
margin: 0;
padding: 0;
}
/*
* Wizard dialog
*
* TODO: Buttons bar background
*/
QWizard > QWidget {
background-color: #2F343F;
}
/* QT-BUG: Because QFrame { border-color: #323232; } has no effect */
Core--Internal--NewDialog > QFrame#frame {
border: 1px solid #2F343F;
}
/* vvvvvvvvvvvvvvvvvvvvvvvvvv WORKAROUND vvvvvvvvvvvvvvvvvvvvvvvvvv */
/* Related to:
* 1) https://bugreports.qt-project.org/browse/QTCREATORBUG-12078
* 2) https://codereview.qt-project.org/#/c/74538/
* Because of bugs in QtGui, apllying stylesheet to QPlainTextEdit causes it
* to lose font settings and palette on setParent event. So switching between
* modes (Editor and Debug) or split Editor resets font and color of edit
* and extra edit areas
* To workaround this problems set you own peferred colors and font below
*/
QPlainTextEdit {
background-color: #2F343F;
selection-background-color: #214283;
color: #bbbbbb;
selection-color: #bbbbbb; /* No better workaround for this */
font: 10pt Courier, Inconsolata, Monospace;
}
/*TextEditor--Internal--TextEditExtraArea*/
TextEditor--TextEditorWidget > QWidget {
background-color: #2F343F;
selection-background-color: #4b6eaf;
color: #bbbbbb; /* QT-BUG: Sadly this has no effect */
}
/* ^^^^^^^^^^^^^^^^^^^^^^^^^^ WORKAROUND ^^^^^^^^^^^^^^^^^^^^^^^^^^ */
#end /home/serg/.config/QtProject/qtcreator/styles/onedark.css
#start /home/serg/.local/share/applications/DigiaQt-qtcreator-community.desktop
[Desktop Entry]
Type=Application
#Exec="/home/serg/Qt5.9.3/Tools/QtCreator/bin/qtcreator -color "#313E5A" -stylesheet /home/serg/.config/QtProject/qtcreator/styles/onedark.css"
#Exec=/home/serg/Qt5.9.3/Tools/QtCreator/bin/styled_qtcreator
Exec=sh -c "/home/serg/Qt5.9.3/Tools/QtCreator/bin/qtcreator -color \"#313E5A\" -stylesheet /home/serg/.config/QtProject/qtcreator/styles/onedark.css"
Name=Qt Creator (Community)
GenericName=The IDE of choice for Qt development.
Icon=QtProject-qtcreator
StartupWMClass=qtcreator
Terminal=false
Categories=Development;IDE;Qt;
MimeType=text/x-c++src;text/x-c++hdr;text/x-xsrc;application/x-designer;application/vnd.qt.qmakeprofile;application/vnd.qt.xml.resource;text/x-qml;text/x-qt.qml;text/x-qt.qbs;
#end /home/serg/.local/share/applications/DigiaQt-qtcreator-community.desktop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment