mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
Merge branch 'pr1500'
This commit is contained in:
commit
8d91997ae5
|
@ -133,7 +133,10 @@ void Widget::init()
|
||||||
ui->mainHead->layout()->setMargin(0);
|
ui->mainHead->layout()->setMargin(0);
|
||||||
ui->mainHead->layout()->setSpacing(0);
|
ui->mainHead->layout()->setSpacing(0);
|
||||||
|
|
||||||
ui->tooliconsZone->setStyleSheet(Style::resolve("QPushButton{background-color:@themeDark;border:none;}QPushButton:hover{background-color:@themeMediumDark;border:none;}"));
|
ui->addButton->setCheckable(true);
|
||||||
|
ui->groupButton->setCheckable(false);
|
||||||
|
ui->transferButton->setCheckable(true);
|
||||||
|
ui->settingsButton->setCheckable(true);
|
||||||
|
|
||||||
if (QStyleFactory::keys().contains(Settings::getInstance().getStyle())
|
if (QStyleFactory::keys().contains(Settings::getInstance().getStyle())
|
||||||
&& Settings::getInstance().getStyle() != "None")
|
&& Settings::getInstance().getStyle() != "None")
|
||||||
|
@ -207,6 +210,7 @@ void Widget::init()
|
||||||
|
|
||||||
addFriendForm->show(*ui);
|
addFriendForm->show(*ui);
|
||||||
setWindowTitle(tr("Add friend"));
|
setWindowTitle(tr("Add friend"));
|
||||||
|
setActiveToolMenuButton(Widget::AddButton);
|
||||||
|
|
||||||
connect(settingsWidget, &SettingsWidget::groupchatPositionToggled, contactListWidget, &FriendListWidget::onGroupchatPositionChanged);
|
connect(settingsWidget, &SettingsWidget::groupchatPositionToggled, contactListWidget, &FriendListWidget::onGroupchatPositionChanged);
|
||||||
#if (AUTOUPDATE_ENABLED)
|
#if (AUTOUPDATE_ENABLED)
|
||||||
|
@ -434,6 +438,7 @@ void Widget::onAddClicked()
|
||||||
hideMainForms();
|
hideMainForms();
|
||||||
addFriendForm->show(*ui);
|
addFriendForm->show(*ui);
|
||||||
setWindowTitle(tr("Add friend"));
|
setWindowTitle(tr("Add friend"));
|
||||||
|
setActiveToolMenuButton(Widget::AddButton);
|
||||||
activeChatroomWidget = nullptr;
|
activeChatroomWidget = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -447,6 +452,7 @@ void Widget::onTransferClicked()
|
||||||
hideMainForms();
|
hideMainForms();
|
||||||
filesForm->show(*ui);
|
filesForm->show(*ui);
|
||||||
setWindowTitle(tr("File transfers"));
|
setWindowTitle(tr("File transfers"));
|
||||||
|
setActiveToolMenuButton(Widget::TransferButton);
|
||||||
activeChatroomWidget = nullptr;
|
activeChatroomWidget = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -527,6 +533,7 @@ void Widget::onSettingsClicked()
|
||||||
hideMainForms();
|
hideMainForms();
|
||||||
settingsWidget->show(*ui);
|
settingsWidget->show(*ui);
|
||||||
setWindowTitle(tr("Settings"));
|
setWindowTitle(tr("Settings"));
|
||||||
|
setActiveToolMenuButton(Widget::SettingButton);
|
||||||
activeChatroomWidget = nullptr;
|
activeChatroomWidget = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -729,6 +736,7 @@ void Widget::onFriendUsernameChanged(int friendId, const QString& username)
|
||||||
void Widget::onChatroomWidgetClicked(GenericChatroomWidget *widget)
|
void Widget::onChatroomWidgetClicked(GenericChatroomWidget *widget)
|
||||||
{
|
{
|
||||||
hideMainForms();
|
hideMainForms();
|
||||||
|
setActiveToolMenuButton(Widget::None);
|
||||||
widget->setChatForm(*ui);
|
widget->setChatForm(*ui);
|
||||||
if (activeChatroomWidget != nullptr)
|
if (activeChatroomWidget != nullptr)
|
||||||
activeChatroomWidget->setAsInactiveChatroom();
|
activeChatroomWidget->setAsInactiveChatroom();
|
||||||
|
@ -1277,7 +1285,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;}"));
|
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->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"));
|
||||||
|
@ -1358,3 +1366,15 @@ Status Widget::getStatusFromString(QString status)
|
||||||
else
|
else
|
||||||
return Status::Offline;
|
return Status::Offline;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Widget::setActiveToolMenuButton(ActiveToolMenuButton newActiveButton)
|
||||||
|
{
|
||||||
|
ui->addButton->setChecked(newActiveButton == Widget::AddButton);
|
||||||
|
ui->addButton->setDisabled(newActiveButton == Widget::AddButton);
|
||||||
|
ui->groupButton->setChecked(newActiveButton == Widget::GroupButton);
|
||||||
|
ui->groupButton->setDisabled(newActiveButton == Widget::GroupButton);
|
||||||
|
ui->transferButton->setChecked(newActiveButton == Widget::TransferButton);
|
||||||
|
ui->transferButton->setDisabled(newActiveButton == Widget::TransferButton);
|
||||||
|
ui->settingsButton->setChecked(newActiveButton == Widget::SettingButton);
|
||||||
|
ui->settingsButton->setDisabled(newActiveButton == Widget::SettingButton);
|
||||||
|
}
|
||||||
|
|
|
@ -151,6 +151,14 @@ private slots:
|
||||||
void processOfflineMsgs();
|
void processOfflineMsgs();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
enum ActiveToolMenuButton {
|
||||||
|
AddButton,
|
||||||
|
GroupButton,
|
||||||
|
TransferButton,
|
||||||
|
SettingButton,
|
||||||
|
None,
|
||||||
|
};
|
||||||
|
void setActiveToolMenuButton(ActiveToolMenuButton newActiveButton);
|
||||||
void hideMainForms();
|
void hideMainForms();
|
||||||
virtual bool event(QEvent * e);
|
virtual bool event(QEvent * e);
|
||||||
Group *createGroup(int groupId);
|
Group *createGroup(int groupId);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user