Skip to content

Commit

Permalink
更新input
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Dec 20, 2021
1 parent 4a95531 commit b3f9e9a
Show file tree
Hide file tree
Showing 2 changed files with 91 additions and 1 deletion.
88 changes: 87 additions & 1 deletion Examples/CatWidgetExamples/Resource/qss/CatGray/InputTools.css
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,90 @@ QLineEdit {
border: 1px solid #959595;
border-radius: 3px;
background-color: #757575;
}
}

QLineEdit:focus {
color: white;
border: 1px solid rgba(223,74,22,100%);
}

QLineEdit:!enabled {
color: #818BA7;
border: 1px solid #EFF1F6;
background-color: #EFF1F6;
}


QComboBox {
color: #C1C1C1;
font-family: "Ubuntu";
border: 1px solid #313131;
background-color: #484848;
border-radius: 3px;
padding: 1px 18px 1px 3px;
min-width: 150px;
min-height: 30px;
}


QComboBox:editable {
color: #C1C1C1;
background: #484848;
}

QComboBox:!editable, QComboBox::drop-down:editable {
border: 1px solid #313131;
background: #484848;
}

/* 当弹出窗口打开时,QComboBox将处于“on”状态 */
QComboBox:!editable:on, QComboBox::drop-down:editable:on {
border: 1px solid rgba(223,74,22,100%);
background: #484848;
}

QComboBox:on { /* 当弹出窗口打开时,移动文本 */
padding-top: 3px;
padding-left: 4px;
}

QComboBox::drop-down {
subcontrol-origin: padding;
subcontrol-position: top right;
width: 15px;
border-top-right-radius: 3px; /* 半径与QComboBox相同 */
border-bottom-right-radius: 3px;
}

QComboBox::down-arrow {
padding-right: 6px;
image: url(:/Images/CatGray/PullDown.png);
}

QComboBox::down-arrow:on {
padding-right: 6px;
image: url(:/Images/CatGray/PullUp.png);
}


QSpinBox {
color: white;
border: 1px solid #959595;
background-color: #757575;
border-radius: 2px; /* 圆角 */
font-family: "Ubuntu";
}

QSpinBox:focus {
border: 1px solid rgba(223,74,22,100%);
}

/*spinbox 抬起样式*/
QSpinBox::up-button
{
image: url(:/Images/CatGray/PullUp.png);
}
QSpinBox::down-button
{
image: url(:/Images/CatGray/PullDown.png);
}
4 changes: 4 additions & 0 deletions Examples/CatWidgetExamples/WidgetTools/InputTools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
#include <QFontComboBox>
#include <QKeySequenceEdit>

#include <QListView>

InputTools::InputTools(QWidget *parent) :
QWidget(parent),
ui(new Ui::InputTools)
Expand Down Expand Up @@ -96,9 +98,11 @@ void InputTools::InitDefauleSlider()

QComboBox *combobox = new QComboBox(this);
combobox->setMinimumWidth(200);
combobox->setView(new QListView);

QFontComboBox *fontcombobox = new QFontComboBox(this);
fontcombobox->setMinimumWidth(200);
fontcombobox->setView(new QListView);

QKeySequenceEdit *keysequenceedit = new QKeySequenceEdit(this);
keysequenceedit->setMinimumWidth(200);
Expand Down

0 comments on commit b3f9e9a

Please sign in to comment.