mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
style(widget): Style fixes
This commit is contained in:
parent
88eca7e200
commit
76f694fe73
2
res.qrc
2
res.qrc
|
@ -131,5 +131,7 @@
|
||||||
<file>ui/loginScreen/loginScreen.css</file>
|
<file>ui/loginScreen/loginScreen.css</file>
|
||||||
<file>img/others/logout-icon.svg</file>
|
<file>img/others/logout-icon.svg</file>
|
||||||
<file>img/caps_lock.svg</file>
|
<file>img/caps_lock.svg</file>
|
||||||
|
<file>ui/contentDialog/contentDialog.css</file>
|
||||||
|
<file>ui/tooliconsZone/tooliconsZone.css</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|
|
@ -254,11 +254,9 @@ void CategoryWidget::onCompactChanged(bool _compact)
|
||||||
topLayout->setSpacing(0);
|
topLayout->setSpacing(0);
|
||||||
topLayout->setMargin(0);
|
topLayout->setMargin(0);
|
||||||
|
|
||||||
(void)_compact;
|
Q_UNUSED(_compact);
|
||||||
setCompact(true);
|
setCompact(true);
|
||||||
|
|
||||||
if (true)
|
|
||||||
{
|
|
||||||
nameLabel->minimizeMaximumWidth();
|
nameLabel->minimizeMaximumWidth();
|
||||||
|
|
||||||
mainLayout = nullptr;
|
mainLayout = nullptr;
|
||||||
|
@ -275,31 +273,6 @@ void CategoryWidget::onCompactChanged(bool _compact)
|
||||||
topLayout->addWidget(statusLabel);
|
topLayout->addWidget(statusLabel);
|
||||||
topLayout->addSpacing(5);
|
topLayout->addSpacing(5);
|
||||||
topLayout->activate();
|
topLayout->activate();
|
||||||
}
|
|
||||||
/*else
|
|
||||||
{
|
|
||||||
nameLabel->setMaximumWidth(QWIDGETSIZE_MAX);
|
|
||||||
|
|
||||||
mainLayout = new QVBoxLayout();
|
|
||||||
mainLayout->setSpacing(0);
|
|
||||||
mainLayout->setContentsMargins(20, 0, 20, 0);
|
|
||||||
|
|
||||||
container->setFixedHeight(25);
|
|
||||||
container->setLayout(mainLayout);
|
|
||||||
|
|
||||||
topLayout->addWidget(&statusPic);
|
|
||||||
topLayout->addSpacing(10);
|
|
||||||
topLayout->addWidget(nameLabel, 1);
|
|
||||||
topLayout->addSpacing(5);
|
|
||||||
topLayout->addWidget(statusLabel);
|
|
||||||
topLayout->activate();
|
|
||||||
|
|
||||||
mainLayout->addStretch();
|
|
||||||
mainLayout->addLayout(topLayout);
|
|
||||||
mainLayout->addWidget(lineFrame);
|
|
||||||
mainLayout->addStretch();
|
|
||||||
mainLayout->activate();
|
|
||||||
}*/
|
|
||||||
|
|
||||||
Style::repolish(this);
|
Style::repolish(this);
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,7 +59,7 @@ ContentDialog::ContentDialog(SettingsWidget* settingsWidget, QWidget* parent)
|
||||||
boxLayout->setSpacing(0);
|
boxLayout->setSpacing(0);
|
||||||
|
|
||||||
splitter = new QSplitter(this);
|
splitter = new QSplitter(this);
|
||||||
setStyleSheet("QSplitter{color: rgb(255, 255, 255);background-color: rgb(255, 255, 255);alternate-background-color: rgb(255, 255, 255);border-color: rgb(255, 255, 255);gridline-color: rgb(255, 255, 255);selection-color: rgb(255, 255, 255);selection-background-color: rgb(255, 255, 255);}QSplitter:handle{color: rgb(255, 255, 255);background-color: rgb(255, 255, 255);}");
|
setStyleSheet(Style::getStylesheet(":/ui/contentDialog/contentDialog.css"));
|
||||||
splitter->setHandleWidth(6);
|
splitter->setHandleWidth(6);
|
||||||
|
|
||||||
QWidget *friendWidget = new QWidget();
|
QWidget *friendWidget = new QWidget();
|
||||||
|
|
|
@ -137,9 +137,8 @@ bool AddFriendForm::addFriendRequest(const QString &friendAddress, const QString
|
||||||
{
|
{
|
||||||
addFriendRequestWidget(friendAddress, message);
|
addFriendRequestWidget(friendAddress, message);
|
||||||
if (isShown())
|
if (isShown())
|
||||||
{
|
|
||||||
onCurrentChanged(tabWidget->currentIndex());
|
onCurrentChanged(tabWidget->currentIndex());
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -203,7 +202,8 @@ void AddFriendForm::onIdChanged(const QString &id)
|
||||||
QStringLiteral(" (") +
|
QStringLiteral(" (") +
|
||||||
toxIdComment +
|
toxIdComment +
|
||||||
QStringLiteral(")"));
|
QStringLiteral(")"));
|
||||||
} else
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
toxIdLabel.setText(toxIdText +
|
toxIdLabel.setText(toxIdText +
|
||||||
QStringLiteral(" <font color='red'>(") +
|
QStringLiteral(" <font color='red'>(") +
|
||||||
|
|
|
@ -580,7 +580,7 @@ void ChatForm::onEnableCallButtons()
|
||||||
|
|
||||||
void ChatForm::onMicMuteToggle()
|
void ChatForm::onMicMuteToggle()
|
||||||
{
|
{
|
||||||
if (audioInputFlag == true)
|
if (audioInputFlag)
|
||||||
{
|
{
|
||||||
coreav->micMuteToggle(f->getFriendID());
|
coreav->micMuteToggle(f->getFriendID());
|
||||||
if (micButton->objectName() == "red")
|
if (micButton->objectName() == "red")
|
||||||
|
@ -600,7 +600,7 @@ void ChatForm::onMicMuteToggle()
|
||||||
|
|
||||||
void ChatForm::onVolMuteToggle()
|
void ChatForm::onVolMuteToggle()
|
||||||
{
|
{
|
||||||
if (audioOutputFlag == true)
|
if (audioOutputFlag)
|
||||||
{
|
{
|
||||||
coreav->volMuteToggle(f->getFriendID());
|
coreav->volMuteToggle(f->getFriendID());
|
||||||
if (volButton->objectName() == "red")
|
if (volButton->objectName() == "red")
|
||||||
|
|
|
@ -92,6 +92,12 @@ private slots:
|
||||||
private:
|
private:
|
||||||
void retranslateUi();
|
void retranslateUi();
|
||||||
void showOutgoingCall(bool video);
|
void showOutgoingCall(bool video);
|
||||||
|
void startCounter();
|
||||||
|
void stopCounter();
|
||||||
|
QString secondsToDHMS(quint32 duration);
|
||||||
|
void enableCallButtons();
|
||||||
|
void disableCallButtons();
|
||||||
|
void SendMessageStr(QString msg);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual GenericNetCamView* createNetcam() final override;
|
virtual GenericNetCamView* createNetcam() final override;
|
||||||
|
@ -117,14 +123,8 @@ private:
|
||||||
|
|
||||||
ScreenshotGrabber* screenshotGrabber;
|
ScreenshotGrabber* screenshotGrabber;
|
||||||
QHash<uint, FileTransferInstance*> ftransWidgets;
|
QHash<uint, FileTransferInstance*> ftransWidgets;
|
||||||
void startCounter();
|
|
||||||
void stopCounter();
|
|
||||||
QString secondsToDHMS(quint32 duration);
|
|
||||||
CallConfirmWidget *callConfirm;
|
CallConfirmWidget *callConfirm;
|
||||||
void enableCallButtons();
|
|
||||||
void disableCallButtons();
|
|
||||||
bool isTyping;
|
bool isTyping;
|
||||||
void SendMessageStr(QString msg);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // CHATFORM_H
|
#endif // CHATFORM_H
|
||||||
|
|
|
@ -470,18 +470,14 @@ QString GenericChatForm::resolveToxId(const ToxId &id)
|
||||||
{
|
{
|
||||||
Friend *f = FriendList::findFriend(id);
|
Friend *f = FriendList::findFriend(id);
|
||||||
if (f)
|
if (f)
|
||||||
{
|
|
||||||
return f->getDisplayedName();
|
return f->getDisplayedName();
|
||||||
}
|
|
||||||
else
|
for (Group *it : GroupList::getAllGroups())
|
||||||
{
|
|
||||||
for (auto it : GroupList::getAllGroups())
|
|
||||||
{
|
{
|
||||||
QString res = it->resolveToxId(id);
|
QString res = it->resolveToxId(id);
|
||||||
if (res.size())
|
if (res.size())
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
|
@ -285,7 +285,7 @@ void GroupChatForm::dropEvent(QDropEvent *ev)
|
||||||
|
|
||||||
void GroupChatForm::onMicMuteToggle()
|
void GroupChatForm::onMicMuteToggle()
|
||||||
{
|
{
|
||||||
if (audioInputFlag == true)
|
if (audioInputFlag)
|
||||||
{
|
{
|
||||||
if (micButton->objectName() == "red")
|
if (micButton->objectName() == "red")
|
||||||
{
|
{
|
||||||
|
@ -306,7 +306,7 @@ void GroupChatForm::onMicMuteToggle()
|
||||||
|
|
||||||
void GroupChatForm::onVolMuteToggle()
|
void GroupChatForm::onVolMuteToggle()
|
||||||
{
|
{
|
||||||
if (audioOutputFlag == true)
|
if (audioOutputFlag)
|
||||||
{
|
{
|
||||||
if (volButton->objectName() == "red")
|
if (volButton->objectName() == "red")
|
||||||
{
|
{
|
||||||
|
|
|
@ -187,9 +187,8 @@ void GroupInviteForm::retranslateUi()
|
||||||
{
|
{
|
||||||
headLabel->setText(tr("Groups"));
|
headLabel->setText(tr("Groups"));
|
||||||
if (createButton)
|
if (createButton)
|
||||||
{
|
|
||||||
createButton->setText(tr("Create new group"));
|
createButton->setText(tr("Create new group"));
|
||||||
}
|
|
||||||
inviteBox->setTitle(tr("Group invites"));
|
inviteBox->setTitle(tr("Group invites"));
|
||||||
|
|
||||||
for (QPushButton* acceptButton : acceptButtons)
|
for (QPushButton* acceptButton : acceptButtons)
|
||||||
|
|
|
@ -45,7 +45,10 @@ signals:
|
||||||
void clicked();
|
void clicked();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void mouseReleaseEvent(QMouseEvent*) final override {emit clicked();}
|
virtual void mouseReleaseEvent(QMouseEvent*) final override
|
||||||
|
{
|
||||||
|
emit clicked();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class ProfileForm : public QWidget
|
class ProfileForm : public QWidget
|
||||||
|
|
|
@ -35,7 +35,10 @@ class AboutForm : public GenericForm
|
||||||
public:
|
public:
|
||||||
AboutForm();
|
AboutForm();
|
||||||
~AboutForm();
|
~AboutForm();
|
||||||
virtual QString getFormName() final override {return tr("About");}
|
virtual QString getFormName() final override
|
||||||
|
{
|
||||||
|
return tr("About");
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,10 @@ class AdvancedForm : public GenericForm
|
||||||
public:
|
public:
|
||||||
AdvancedForm();
|
AdvancedForm();
|
||||||
~AdvancedForm();
|
~AdvancedForm();
|
||||||
virtual QString getFormName() final override {return tr("Advanced");}
|
virtual QString getFormName() final override
|
||||||
|
{
|
||||||
|
return tr("Advanced");
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool eventFilter(QObject *o, QEvent *e) final override;
|
bool eventFilter(QObject *o, QEvent *e) final override;
|
||||||
|
|
|
@ -34,7 +34,10 @@ class GeneralForm : public GenericForm
|
||||||
public:
|
public:
|
||||||
explicit GeneralForm(SettingsWidget *parent);
|
explicit GeneralForm(SettingsWidget *parent);
|
||||||
~GeneralForm();
|
~GeneralForm();
|
||||||
virtual QString getFormName() final override {return tr("General");}
|
virtual QString getFormName() final override
|
||||||
|
{
|
||||||
|
return tr("General");
|
||||||
|
}
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void onEnableIPv6Updated();
|
void onEnableIPv6Updated();
|
||||||
|
|
|
@ -28,7 +28,10 @@ public:
|
||||||
virtual ~GenericForm() {}
|
virtual ~GenericForm() {}
|
||||||
|
|
||||||
virtual QString getFormName() = 0;
|
virtual QString getFormName() = 0;
|
||||||
QPixmap getFormIcon() {return formIcon;}
|
QPixmap getFormIcon()
|
||||||
|
{
|
||||||
|
return formIcon;
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QPixmap formIcon;
|
QPixmap formIcon;
|
||||||
|
|
|
@ -32,7 +32,10 @@ class PrivacyForm : public GenericForm
|
||||||
public:
|
public:
|
||||||
PrivacyForm();
|
PrivacyForm();
|
||||||
~PrivacyForm();
|
~PrivacyForm();
|
||||||
virtual QString getFormName() final override {return tr("Privacy");}
|
virtual QString getFormName() final override
|
||||||
|
{
|
||||||
|
return tr("Privacy");
|
||||||
|
}
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void onEnableLoggingUpdated();
|
void onEnableLoggingUpdated();
|
||||||
|
|
|
@ -184,14 +184,10 @@ void GenericChatroomWidget::reloadTheme()
|
||||||
void GenericChatroomWidget::mouseReleaseEvent(QMouseEvent* event)
|
void GenericChatroomWidget::mouseReleaseEvent(QMouseEvent* event)
|
||||||
{
|
{
|
||||||
if (event->button() == Qt::LeftButton)
|
if (event->button() == Qt::LeftButton)
|
||||||
{
|
|
||||||
emit chatroomWidgetClicked(this);
|
emit chatroomWidgetClicked(this);
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
event->ignore();
|
event->ignore();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void GenericChatroomWidget::enterEvent(QEvent*)
|
void GenericChatroomWidget::enterEvent(QEvent*)
|
||||||
{
|
{
|
||||||
|
|
|
@ -40,7 +40,7 @@ LoginScreen::LoginScreen(QWidget *parent) :
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
// permanently disables maximize button https://github.com/tux3/qTox/issues/1973
|
// permanently disables maximize button https://github.com/tux3/qTox/issues/1973
|
||||||
this->setWindowFlags(windowFlags() &! Qt::WindowMaximizeButtonHint);
|
this->setWindowFlags(windowFlags() & ~Qt::WindowMaximizeButtonHint);
|
||||||
this->setFixedSize(this->size());
|
this->setFixedSize(this->size());
|
||||||
|
|
||||||
connect(&quitShortcut, &QShortcut::activated, this, &LoginScreen::close);
|
connect(&quitShortcut, &QShortcut::activated, this, &LoginScreen::close);
|
||||||
|
@ -271,9 +271,9 @@ void LoginScreen::retranslateUi()
|
||||||
void LoginScreen::onImportProfile()
|
void LoginScreen::onImportProfile()
|
||||||
{
|
{
|
||||||
ProfileImporter *pi = new ProfileImporter(this);
|
ProfileImporter *pi = new ProfileImporter(this);
|
||||||
if(pi->importProfile() == true)
|
|
||||||
{
|
if (pi->importProfile())
|
||||||
reset();
|
reset();
|
||||||
}
|
|
||||||
delete pi;
|
delete pi;
|
||||||
}
|
}
|
||||||
|
|
|
@ -205,7 +205,6 @@ void ScreenGrabberChooserRectItem::mousePressHandle(int x, int y, QGraphicsScene
|
||||||
|
|
||||||
if (event->button() == Qt::LeftButton)
|
if (event->button() == Qt::LeftButton)
|
||||||
this->state = HandleResizing;
|
this->state = HandleResizing;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScreenGrabberChooserRectItem::mouseMoveHandle(int x, int y, QGraphicsSceneMouseEvent* event)
|
void ScreenGrabberChooserRectItem::mouseMoveHandle(int x, int y, QGraphicsSceneMouseEvent* event)
|
||||||
|
|
|
@ -563,7 +563,7 @@ void Widget::moveEvent(QMoveEvent *event)
|
||||||
|
|
||||||
void Widget::closeEvent(QCloseEvent *event)
|
void Widget::closeEvent(QCloseEvent *event)
|
||||||
{
|
{
|
||||||
if (Settings::getInstance().getShowSystemTray() && Settings::getInstance().getCloseToTray() == true)
|
if (Settings::getInstance().getShowSystemTray() && Settings::getInstance().getCloseToTray())
|
||||||
{
|
{
|
||||||
event->ignore();
|
event->ignore();
|
||||||
this->hide();
|
this->hide();
|
||||||
|
@ -1981,7 +1981,7 @@ void Widget::clearAllReceipts()
|
||||||
void Widget::reloadTheme()
|
void Widget::reloadTheme()
|
||||||
{
|
{
|
||||||
QString statusPanelStyle = Style::getStylesheet(":/ui/window/statusPanel.css");
|
QString statusPanelStyle = Style::getStylesheet(":/ui/window/statusPanel.css");
|
||||||
ui->tooliconsZone->setStyleSheet(Style::resolve("QPushButton{background-color:@themeDark;border:none;}QPushButton:hover{background-color:@themeMediumDark;border:none;}QPushButton:checked{background-color:@themeMedium;border:none;}QPushButton:pressed{background-color:@themeMediumLight;border:none;}"));
|
ui->tooliconsZone->setStyleSheet(Style::getStylesheet(":/ui/tooliconsZone/tooliconsZone.css"));
|
||||||
ui->statusPanel->setStyleSheet(statusPanelStyle);
|
ui->statusPanel->setStyleSheet(statusPanelStyle);
|
||||||
ui->statusHead->setStyleSheet(statusPanelStyle);
|
ui->statusHead->setStyleSheet(statusPanelStyle);
|
||||||
ui->friendList->setStyleSheet(Style::getStylesheet(":/ui/friendList/friendList.css"));
|
ui->friendList->setStyleSheet(Style::getStylesheet(":/ui/friendList/friendList.css"));
|
||||||
|
|
16
ui/contentDialog/contentDialog.css
Normal file
16
ui/contentDialog/contentDialog.css
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
QSplitter
|
||||||
|
{
|
||||||
|
color: white;
|
||||||
|
background-color: white;
|
||||||
|
alternate-background-color: white;
|
||||||
|
border-color: white;
|
||||||
|
gridline-color: white;
|
||||||
|
selection-color: white;
|
||||||
|
selection-background-color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
QSplitter:handle
|
||||||
|
{
|
||||||
|
color: white;
|
||||||
|
background-color: white;
|
||||||
|
}
|
23
ui/tooliconsZone/tooliconsZone.css
Normal file
23
ui/tooliconsZone/tooliconsZone.css
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
QPushButton
|
||||||
|
{
|
||||||
|
background-color: @themeDark;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
QPushButton:hover
|
||||||
|
{
|
||||||
|
background-color: @themeMediumDark;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
QPushButton:checked
|
||||||
|
{
|
||||||
|
background-color: @themeMedium;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
QPushButton:pressed
|
||||||
|
{
|
||||||
|
background-color: @themeMediumLight;
|
||||||
|
border: none;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user