Skip to content

Commit

Permalink
Staged: Initialez changes for dark theme testing
Browse files Browse the repository at this point in the history
  • Loading branch information
JairajJangle committed Jun 11, 2020
1 parent 75fdeab commit 42b4d43
Show file tree
Hide file tree
Showing 219 changed files with 2,610 additions and 153 deletions.
4 changes: 2 additions & 2 deletions CustomWidgets/ChainMenuWidget/chainmenuwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ ChainMenuWidget::ChainMenuWidget(QWidget *parent) :
ui->comboBox->addItem(chainMenuItem.second, chainMenuItem.first);
}

connect(ui->buttonAdd, &QPushButton::released,this,
connect(ui->buttonAdd, &QToolButton::released,this,
[=](){
emit addOperationClicked();
});

connect(ui->buttonRemove, &QPushButton::released,this,
connect(ui->buttonRemove, &QToolButton::released,this,
[=](){
emit removeOperationClicked();
});
Expand Down
22 changes: 16 additions & 6 deletions CustomWidgets/ChainMenuWidget/chainmenuwidget.ui
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>270</width>
<height>65</height>
<height>67</height>
</rect>
</property>
<property name="maximumSize">
Expand Down Expand Up @@ -41,18 +41,24 @@
<number>0</number>
</property>
<item>
<layout class="QHBoxLayout" name="horizontalLayout" stretch="1,10,1">
<layout class="QHBoxLayout" name="horizontalLayout" stretch="0,10,0">
<property name="spacing">
<number>2</number>
</property>
<item>
<widget class="QPushButton" name="buttonRemove">
<widget class="QToolButton" name="buttonRemove">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>35</width>
<height>35</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>35</width>
Expand All @@ -74,7 +80,6 @@
#buttonRemove:disabled
{
color: #787878;
background-color: #ffffff;
}</string>
</property>
<property name="text">
Expand Down Expand Up @@ -105,13 +110,19 @@ background-color: #ffffff;
</widget>
</item>
<item>
<widget class="QPushButton" name="buttonAdd">
<widget class="QToolButton" name="buttonAdd">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>35</width>
<height>35</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>35</width>
Expand All @@ -133,7 +144,6 @@ background-color: #ffffff;
#buttonAdd:disabled
{
color: #787878;
background-color: #ffffff;
}</string>
</property>
<property name="text">
Expand Down
14 changes: 8 additions & 6 deletions CustomWidgets/Collapsible/collapsible.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
Collapsible::Collapsible(const int animationDuration,
QWidget *parent) : QFrame(parent), animationDuration(animationDuration)
{
this->setObjectName("collapsibleFrame");
this->setStyleSheet("QFrame#collapsibleFrame { border: 1px solid #54636D; }");
toggleButton->setText(Strings::noOperationSelected);
toggleButton->setStyleSheet("QToolButton { border: none; }");
toggleButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
Expand All @@ -19,11 +21,11 @@ Collapsible::Collapsible(const int animationDuration,
infoButton->setStyleSheet(infoButtonStyleSheet);
infoButton->hide();

removeButton->setMaximumSize(25, 25);
removeButton->setFixedSize(25, 25);
removeButton->setObjectName("removeButton");
removeButton->setText("");
removeButton->setStyleSheet(removeButtonStyleSheet);
connect(removeButton, &QPushButton::released,
connect(removeButton, &QToolButton::released,
this, [=]() {
emit removeButtonClicked();
});
Expand All @@ -36,7 +38,7 @@ Collapsible::Collapsible(const int animationDuration,
hBox->addWidget(headerLine);
hBox->addWidget(infoButton);

// contentArea.setStyleSheet("QScrollArea { background-color: white; border: none; }");
contentArea->setStyleSheet("QScrollArea {border: none; }");
contentArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
contentArea->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
contentArea->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
Expand All @@ -54,9 +56,9 @@ Collapsible::Collapsible(const int animationDuration,
int row = 0;
mainLayout->addWidget(toggleButton, row, 0, 1, 1, Qt::AlignLeft);
mainLayout->addWidget(infoButton, row, 1, 1, 1);
mainLayout->addWidget(headerLine, row++, 2, 1, 1);
mainLayout->addWidget(headerLine, row, 2, 1, 1);
// mainLayout->addWidget(removeButton, row++, 4, 1, 2);
mainLayout->addWidget(contentArea, row, 0, 1, 8);
mainLayout->addWidget(contentArea, ++row, 0, 1, 8);
setLayout(mainLayout);
QObject::connect(toggleButton, &QToolButton::clicked, [this](const bool checked) {
toggleButton->setArrowType(checked ? Qt::ArrowType::DownArrow : Qt::ArrowType::RightArrow);
Expand Down Expand Up @@ -97,7 +99,7 @@ void Collapsible::setContentLayout(QWidget* contentLayout,
if(infoLink != "")
{
infoButton->show();
connect(infoButton, &QPushButton::released,
connect(infoButton, &QToolButton::released,
this, [=]() {
QDesktopServices::openUrl(QUrl(infoLink));
});
Expand Down
12 changes: 6 additions & 6 deletions CustomWidgets/Collapsible/collapsible.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,21 @@ class Collapsible : public QFrame {
QGridLayout* mainLayout = new QGridLayout();
QToolButton* toggleButton = new QToolButton();
QFrame* headerLine = new QFrame();
QPushButton* infoButton = new QPushButton();
QPushButton* removeButton = new QPushButton();
QToolButton* infoButton = new QToolButton();
QToolButton* removeButton = new QToolButton();
QParallelAnimationGroup* toggleAnimation = new QParallelAnimationGroup();
QScrollArea* contentArea = new QScrollArea();
int animationDuration{300};

QString infoButtonStyleSheet = QString("QPushButton#infoButton"
QString infoButtonStyleSheet = QString("QToolButton#infoButton"
"{"
" background-color: transparent;"
" border-image: url(:/assets/info.png);"
" background: none;"
" border: none;"
" background-repeat: none;"
"}"
"QPushButton:pressed#infoButton"
"QToolButton:pressed#infoButton"
"{"
" background-color: transparent;"
" border-image: url(:/assets/info_sel.png);"
Expand All @@ -52,12 +52,12 @@ class Collapsible : public QFrame {
" background-repeat: none;"
"}");

QString removeButtonStyleSheet = QString("QPushButton#removeButton"
QString removeButtonStyleSheet = QString("QToolButton#removeButton"
"{"
" color: red;"
" font-weight: bold;"
"}"
"QPushButton:disabled#buttonRemove"
"QToolButton:disabled#buttonRemove"
"{"
" color: #787878;"
" font-weight: bold;"
Expand Down
3 changes: 2 additions & 1 deletion OpenCV_Catalogue.pro
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target

RESOURCES += \
res.qrc
res.qrc \
qdarkstyle/style.qrc

DISTFILES += \
LICENSE.txt \
Expand Down
2 changes: 1 addition & 1 deletion OpenCV_Catalogue.pro.user
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.12.1, 2020-06-08T17:03:26. -->
<!-- Written by QtCreator 4.12.2, 2020-06-11T20:09:15. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
Expand Down
9 changes: 3 additions & 6 deletions Window/AboutDialog/aboutdialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>434</width>
<height>502</height>
<height>507</height>
</rect>
</property>
<property name="windowTitle">
Expand Down Expand Up @@ -54,7 +54,7 @@
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QPushButton" name="buttonDonatePaypal">
<widget class="QToolButton" name="buttonDonatePaypal">
<property name="minimumSize">
<size>
<width>147</width>
Expand Down Expand Up @@ -83,13 +83,10 @@ background-repeat: none;
<property name="text">
<string/>
</property>
<property name="flat">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="buttonDonateLiberaPay">
<widget class="QToolButton" name="buttonDonateLiberaPay">
<property name="minimumSize">
<size>
<width>96</width>
Expand Down
Loading

0 comments on commit 42b4d43

Please sign in to comment.