From df29e22be01e73a85e0286b02b70fc784562c7d3 Mon Sep 17 00:00:00 2001 From: defnax Date: Mon, 12 Oct 2020 21:46:06 +0200 Subject: [PATCH] Changed the buttons to use QPushButton which is easier with stylesheets * Changed the buttons to use QPushButton which is easier with stylesheets * Use standard strings Create or Post or Update ( not more OK or Send) *Added default stylesheet colors for Create & Post Buttons --- .../src/gui/Circles/CreateCircleDialog.cpp | 12 +- .../src/gui/Circles/CreateCircleDialog.ui | 406 +++++++++--------- .../src/gui/Identity/IdEditDialog.cpp | 7 +- .../src/gui/Identity/IdEditDialog.ui | 16 +- .../src/gui/chat/CreateLobbyDialog.cpp | 10 +- .../src/gui/chat/CreateLobbyDialog.ui | 26 +- .../src/gui/gxsforums/CreateGxsForumMsg.cpp | 17 +- .../src/gui/gxsforums/CreateGxsForumMsg.ui | 21 +- .../src/gui/qss/stylesheet/Standard.qss | 20 + retroshare-gui/src/qss/qdarkstyle-v2.qss | 20 + retroshare-gui/src/qss/qdarkstyle.qss | 21 +- 11 files changed, 339 insertions(+), 237 deletions(-) diff --git a/retroshare-gui/src/gui/Circles/CreateCircleDialog.cpp b/retroshare-gui/src/gui/Circles/CreateCircleDialog.cpp index 40340605b..a0eacd060 100644 --- a/retroshare-gui/src/gui/Circles/CreateCircleDialog.cpp +++ b/retroshare-gui/src/gui/Circles/CreateCircleDialog.cpp @@ -60,8 +60,8 @@ CreateCircleDialog::CreateCircleDialog() connect(ui.addButton, SIGNAL(clicked()), this, SLOT(addMember())); connect(ui.removeButton, SIGNAL(clicked()), this, SLOT(removeMember())); - connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(createCircle())); - connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(close())); + connect(ui.createButton, SIGNAL(clicked()), this, SLOT(createCircle())); + connect(ui.cancelButton, SIGNAL(clicked()), this, SLOT(close())); connect(ui.treeWidget_membership, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), this, SLOT(selectedMember(QTreeWidgetItem*, QTreeWidgetItem*))); connect(ui.treeWidget_IdList, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), this, SLOT(selectedId(QTreeWidgetItem*, QTreeWidgetItem*))); @@ -146,15 +146,15 @@ void CreateCircleDialog::editExistingId(const RsGxsGroupId &circleId, const bool ui.idChooser->setVisible(true) ; } - ui.buttonBox->button(QDialogButtonBox::Ok)->setText(tr("Update")); + ui.createButton->setText(tr("Update")); ui.addButton->setEnabled(!readonly) ; ui.removeButton->setEnabled(!readonly) ; if(readonly) { - ui.buttonBox->setStandardButtons(QDialogButtonBox::Cancel); - ui.buttonBox->button(QDialogButtonBox::Cancel)->setText(tr("Close")); + ui.createButton->hide() ; + ui.cancelButton->setText(tr("Close")); ui.peersSelection_GB->hide() ; ui.addButton->hide() ; ui.removeButton->hide() ; @@ -175,7 +175,7 @@ void CreateCircleDialog::editNewId(bool isExternal) { setupForExternalCircle(); ui.headerFrame->setHeaderText(tr("Create New Circle")); - ui.buttonBox->button(QDialogButtonBox::Ok)->setText(tr("Create")); + ui.createButton->setText(tr("Create")); } else { diff --git a/retroshare-gui/src/gui/Circles/CreateCircleDialog.ui b/retroshare-gui/src/gui/Circles/CreateCircleDialog.ui index 61923d757..54e1fe80f 100644 --- a/retroshare-gui/src/gui/Circles/CreateCircleDialog.ui +++ b/retroshare-gui/src/gui/Circles/CreateCircleDialog.ui @@ -48,199 +48,7 @@ QFrame::Raised - - - - - - Invited Members - - - - - - Qt::CustomContextMenu - - - <html><head/><body><p>Members of this list will be automatically proposed to join the circle (by accepting membership). They will</p><p>not receive data that is restricted to this circle until they do so.</p></body></html> - - - true - - - - Name - - - - - IDs - - - - - - - - - - - - - Qt::Vertical - - - - 20 - 188 - - - - - - - - Add - - - - - - - :/icons/png/arrow-left.png:/icons/png/arrow-left.png - - - - - - - Remove - - - - - - - :/icons/png/arrow-right.png:/icons/png/arrow-right.png - - - - - - - Qt::Vertical - - - - 20 - 178 - - - - - - - - - - Known People - - - - - - Qt::CustomContextMenu - - - true - - - - Nickname - - - - - Profile - - - - - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - All - - - - - - - Signed - - - - - - - Signed by friend node - - - - - - - - - - - - Filter - - - - - - - - - - - - - - - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - + Circle Details @@ -444,6 +252,218 @@ + + + + + + Invited Members + + + + + + Qt::CustomContextMenu + + + <html><head/><body><p>Members of this list will be automatically proposed to join the circle (by accepting membership). They will</p><p>not receive data that is restricted to this circle until they do so.</p></body></html> + + + true + + + + Name + + + + + IDs + + + + + + + + + + + + + Qt::Vertical + + + + 20 + 188 + + + + + + + + Add + + + + + + + :/icons/png/arrow-left.png:/icons/png/arrow-left.png + + + + + + + Remove + + + + + + + :/icons/png/arrow-right.png:/icons/png/arrow-right.png + + + + + + + Qt::Vertical + + + + 20 + 178 + + + + + + + + + + Known People + + + + + + Qt::CustomContextMenu + + + true + + + + Nickname + + + + + Profile + + + + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + All + + + + + + + Signed + + + + + + + Signed by friend node + + + + + + + + + + + + Filter + + + + + + + + + + + + + + + + + Qt::Horizontal + + + + 536 + 20 + + + + + + + + Create + + + + + + + Cancel + + + diff --git a/retroshare-gui/src/gui/Identity/IdEditDialog.cpp b/retroshare-gui/src/gui/Identity/IdEditDialog.cpp index b4c855c1d..557b68550 100644 --- a/retroshare-gui/src/gui/Identity/IdEditDialog.cpp +++ b/retroshare-gui/src/gui/Identity/IdEditDialog.cpp @@ -75,8 +75,8 @@ IdEditDialog::IdEditDialog(QWidget *parent) : /* Connect signals */ connect(ui->radioButton_GpgId, SIGNAL(toggled(bool)), this, SLOT(idTypeToggled(bool))); connect(ui->radioButton_Pseudo, SIGNAL(toggled(bool)), this, SLOT(idTypeToggled(bool))); - connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(submit())); - connect(ui->buttonBox, SIGNAL(rejected()), this, SLOT(reject())); + connect(ui->createButton, SIGNAL(clicked()), this, SLOT(submit())); + connect(ui->cancelButton, SIGNAL(clicked()), this, SLOT(reject())); connect(ui->plainTextEdit_Tag, SIGNAL(textChanged()), this, SLOT(checkNewTag())); connect(ui->pushButton_Tag, SIGNAL(clicked(bool)), this, SLOT(addRecognTag())); @@ -202,6 +202,7 @@ void IdEditDialog::setupExistingId(const RsGxsGroupId& keyId) setWindowTitle(tr("Edit identity")); ui->headerFrame->setHeaderImage(FilesDefs::getPixmapFromQtResourcePath(":/icons/png/person.png")); ui->headerFrame->setHeaderText(tr("Edit identity")); + ui->createButton->setText(tr("Update")); mStateHelper->setLoading(IDEDITDIALOG_LOADID, true); @@ -561,7 +562,7 @@ void IdEditDialog::createId() if(rsIdentity->createIdentity(keyId,params.nickname,params.mImage,!params.isPgpLinked,gpg_password)) { - ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false); + ui->createButton->setEnabled(false); RsIdentityDetails det; diff --git a/retroshare-gui/src/gui/Identity/IdEditDialog.ui b/retroshare-gui/src/gui/Identity/IdEditDialog.ui index 22ed6ebd9..9ed2d258a 100644 --- a/retroshare-gui/src/gui/Identity/IdEditDialog.ui +++ b/retroshare-gui/src/gui/Identity/IdEditDialog.ui @@ -504,9 +504,16 @@ - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + Create + + + + + + + Cancel @@ -523,9 +530,6 @@ 1 - - buttonBox - diff --git a/retroshare-gui/src/gui/chat/CreateLobbyDialog.cpp b/retroshare-gui/src/gui/chat/CreateLobbyDialog.cpp index 41cb8d3bf..a3416b403 100644 --- a/retroshare-gui/src/gui/chat/CreateLobbyDialog.cpp +++ b/retroshare-gui/src/gui/chat/CreateLobbyDialog.cpp @@ -54,8 +54,8 @@ CreateLobbyDialog::CreateLobbyDialog(const std::set& peer_list, int pr ui->lobbyTopic_LE->setPlaceholderText(tr("Set a descriptive topic here")); #endif - connect( ui->buttonBox, SIGNAL(accepted()), this, SLOT(createLobby())); - connect( ui->buttonBox, SIGNAL(rejected()), this, SLOT(close())); + connect( ui->createButton, SIGNAL(clicked()), this, SLOT(createLobby())); + connect( ui->cancelButton, SIGNAL(clicked()), this, SLOT(close())); connect( ui->lobbyName_LE, SIGNAL( textChanged ( QString ) ), this, SLOT( checkTextFields( ) ) ); connect( ui->lobbyTopic_LE, SIGNAL( textChanged ( QString ) ), this, SLOT( checkTextFields( ) ) ); connect( ui->idChooser_CB, SIGNAL( currentIndexChanged ( int ) ), this, SLOT( checkTextFields( ) ) ); @@ -101,10 +101,10 @@ void CreateLobbyDialog::checkTextFields() switch(ui->idChooser_CB->getChosenId(id)) { case GxsIdChooser::NoId: - case GxsIdChooser::None: ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false) ; + case GxsIdChooser::None: ui->createButton->setEnabled(false) ; break ; default: - ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(true) ; + ui->createButton->setEnabled(true) ; break ; } @@ -113,7 +113,7 @@ void CreateLobbyDialog::checkTextFields() rsIdentity->getIdDetails(id,idd) ; if( (!(idd.mFlags & RS_IDENTITY_FLAGS_PGP_KNOWN)) && ui->pgp_signed_CB->isChecked()) - ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false) ; + ui->createButton->setEnabled(false) ; } void CreateLobbyDialog::createLobby() diff --git a/retroshare-gui/src/gui/chat/CreateLobbyDialog.ui b/retroshare-gui/src/gui/chat/CreateLobbyDialog.ui index 77aab56ea..7c4d01aaa 100644 --- a/retroshare-gui/src/gui/chat/CreateLobbyDialog.ui +++ b/retroshare-gui/src/gui/chat/CreateLobbyDialog.ui @@ -216,9 +216,29 @@ 0 - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Create + + + + + + + Cancel diff --git a/retroshare-gui/src/gui/gxsforums/CreateGxsForumMsg.cpp b/retroshare-gui/src/gui/gxsforums/CreateGxsForumMsg.cpp index dd9a242b6..331a37ea4 100644 --- a/retroshare-gui/src/gui/gxsforums/CreateGxsForumMsg.cpp +++ b/retroshare-gui/src/gui/gxsforums/CreateGxsForumMsg.cpp @@ -66,19 +66,19 @@ CreateGxsForumMsg::CreateGxsForumMsg(const RsGxsGroupId &fId, const RsGxsMessage /* Setup UI helper */ mStateHelper = new UIStateHelper(this); - mStateHelper->addWidget(CREATEGXSFORUMMSG_FORUMINFO, ui.buttonBox->button(QDialogButtonBox::Ok)); + mStateHelper->addWidget(CREATEGXSFORUMMSG_FORUMINFO, ui.postButton); mStateHelper->addWidget(CREATEGXSFORUMMSG_FORUMINFO, ui.innerFrame); mStateHelper->addLoadPlaceholder(CREATEGXSFORUMMSG_FORUMINFO, ui.forumName); mStateHelper->addLoadPlaceholder(CREATEGXSFORUMMSG_FORUMINFO, ui.forumSubject); mStateHelper->addClear(CREATEGXSFORUMMSG_FORUMINFO, ui.forumName); - mStateHelper->addWidget(CREATEGXSFORUMMSG_PARENTMSG, ui.buttonBox->button(QDialogButtonBox::Ok)); + mStateHelper->addWidget(CREATEGXSFORUMMSG_PARENTMSG, ui.postButton); mStateHelper->addWidget(CREATEGXSFORUMMSG_PARENTMSG, ui.innerFrame); mStateHelper->addLoadPlaceholder(CREATEGXSFORUMMSG_PARENTMSG, ui.forumName); mStateHelper->addLoadPlaceholder(CREATEGXSFORUMMSG_PARENTMSG, ui.forumSubject); mStateHelper->addClear(CREATEGXSFORUMMSG_PARENTMSG, ui.forumName); - mStateHelper->addWidget(CREATEGXSFORUMMSG_ORIGMSG, ui.buttonBox->button(QDialogButtonBox::Ok)); + mStateHelper->addWidget(CREATEGXSFORUMMSG_ORIGMSG, ui.postButton); mStateHelper->addWidget(CREATEGXSFORUMMSG_ORIGMSG, ui.innerFrame); mStateHelper->addLoadPlaceholder(CREATEGXSFORUMMSG_ORIGMSG, ui.forumName); mStateHelper->addLoadPlaceholder(CREATEGXSFORUMMSG_ORIGMSG, ui.forumSubject); @@ -99,12 +99,9 @@ CreateGxsForumMsg::CreateGxsForumMsg(const RsGxsGroupId &fId, const RsGxsMessage connect(ui.hashBox, SIGNAL(fileHashingFinished(QList)), this, SLOT(fileHashingFinished(QList))); - /* Rename Ok button */ - ui.buttonBox->button(QDialogButtonBox::Ok)->setText(tr("Send")); - // connect up the buttons. - connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(createMsg())); - connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(reject())); + connect(ui.postButton, SIGNAL(clicked()), this, SLOT(createMsg())); + connect(ui.cancelButton, SIGNAL(clicked()), this, SLOT(reject())); connect(ui.emoticonButton, SIGNAL(clicked()), this, SLOT(smileyWidgetForums())); connect(ui.attachFileButton, SIGNAL(clicked()), this, SLOT(addFile())); connect(ui.attachPictureButton, SIGNAL(clicked()), this, SLOT(addPicture())); @@ -363,8 +360,8 @@ void CreateGxsForumMsg::checkLength() text = tr("Warning: This message is too big of %1 characters after HTML conversion.").arg((0-charRemains)); ui.infoLabel->setStyleSheet("QLabel#infoLabel {color: red; font: bold; }"); } - ui.buttonBox->button(QDialogButtonBox::Ok)->setToolTip(text); - ui.buttonBox->button(QDialogButtonBox::Ok)->setEnabled(charRemains>=0); + ui.postButton->setToolTip(text); + ui.postButton->setEnabled(charRemains>=0); ui.infoLabel->setText(text); } diff --git a/retroshare-gui/src/gui/gxsforums/CreateGxsForumMsg.ui b/retroshare-gui/src/gui/gxsforums/CreateGxsForumMsg.ui index e5308f66f..7af77f2d5 100644 --- a/retroshare-gui/src/gui/gxsforums/CreateGxsForumMsg.ui +++ b/retroshare-gui/src/gui/gxsforums/CreateGxsForumMsg.ui @@ -341,28 +341,29 @@ p, li { white-space: pre-wrap; } - + Qt::Horizontal - 242 + 40 20 - - - - 0 - 0 - + + + Post - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + Cancel diff --git a/retroshare-gui/src/gui/qss/stylesheet/Standard.qss b/retroshare-gui/src/gui/qss/stylesheet/Standard.qss index 018239298..e405cc889 100644 --- a/retroshare-gui/src/gui/qss/stylesheet/Standard.qss +++ b/retroshare-gui/src/gui/qss/stylesheet/Standard.qss @@ -133,6 +133,26 @@ CreateGxsChannelMsg QPushButton#postButton:hover { padding: 2px; } +CreateCircleDialog QPushButton#createButton, CreateLobbyDialog QPushButton#createButton, +IdEditDialog QPushButton#createButton, CreateGxsForumMsg QPushButton#postButton { + font: bold; + font-size: 15px; + color: white; + background: #0099cc; + border-radius: 4px; + max-height: 27px; + min-width: 4em; + padding: 2px; +} + +CreateCircleDialog QPushButton#createButton:hover, CreateLobbyDialog QPushButton#createButton:hover, +IdEditDialog QPushButton#createButton:hover, CreateGxsForumMsg QPushButton#postButton:hover { + background: #03b1f3; + border-radius: 4px; + min-width: 4em; + padding: 2px; +} + /* Forums */ GxsForumThreadWidget QLabel#forumName diff --git a/retroshare-gui/src/qss/qdarkstyle-v2.qss b/retroshare-gui/src/qss/qdarkstyle-v2.qss index e96df4876..b41d66e21 100644 --- a/retroshare-gui/src/qss/qdarkstyle-v2.qss +++ b/retroshare-gui/src/qss/qdarkstyle-v2.qss @@ -2070,6 +2070,26 @@ CreateGxsChannelMsg QPushButton#postButton:hover { padding: 2px; } +CreateCircleDialog QPushButton#createButton, CreateLobbyDialog QPushButton#createButton, +IdEditDialog QPushButton#createButton, CreateGxsForumMsg QPushButton#postButton { + font: bold; + font-size: 15px; + color: white; + background: #0099cc; + border-radius: 4px; + max-height: 27px; + min-width: 4em; + padding: 2px; +} + +CreateCircleDialog QPushButton#createButton:hover, CreateLobbyDialog QPushButton#createButton:hover, +IdEditDialog QPushButton#createButton:hover, CreateGxsForumMsg QPushButton#postButton:hover { + background: #03b1f3; + border-radius: 4px; + min-width: 4em; + padding: 2px; +} + QTabBar#smTab::tab{ height: 32px; width: 32px; diff --git a/retroshare-gui/src/qss/qdarkstyle.qss b/retroshare-gui/src/qss/qdarkstyle.qss index e301f6c53..bda162991 100644 --- a/retroshare-gui/src/qss/qdarkstyle.qss +++ b/retroshare-gui/src/qss/qdarkstyle.qss @@ -1235,6 +1235,26 @@ CreateGxsChannelMsg QPushButton#postButton:hover { padding: 2px; } +CreateCircleDialog QPushButton#createButton, CreateLobbyDialog QPushButton#createButton, +IdEditDialog QPushButton#createButton, CreateGxsForumMsg QPushButton#postButton { + font: bold; + font-size: 15px; + color: white; + background: #0099cc; + border-radius: 4px; + max-height: 27px; + min-width: 4em; + padding: 2px; +} + +CreateCircleDialog QPushButton#createButton:hover, CreateLobbyDialog QPushButton#createButton:hover, +IdEditDialog QPushButton#createButton:hover, CreateGxsForumMsg QPushButton#postButton:hover { + background: #03b1f3; + border-radius: 4px; + min-width: 4em; + padding: 2px; +} + QTabBar#smTab::tab{ height: 32px; width: 32px; @@ -1349,7 +1369,6 @@ BoardPostDisplayWidget_card QLabel#titleLabel{ font: bold; } - WireGroupItem QFrame#wire_frame { border: 1px solid #38444d;