mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-22 01:25:10 -07:00
[Settings] Shuffle some settings around (#7084)
* [Settings] Shuffle some settings around Took 21 minutes Took 1 hour 25 minutes * [Settings] Camel case everything * Revert debug schema change * Add new classes * Fix card counters writing to global * Fix CI tests * Fix Windows CI * interface() is a protected keyword for MSVC Took 5 minutes Took 5 seconds * [Settings] Keep menu settings on the appearance settings page Leave the 'Menu settings' group box on the appearance settings page for now; relocating it to the user interface settings page will be done in a separate PR. Took 6 minutes --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
bf6b2a90bc
commit
adf574e038
79 changed files with 1899 additions and 1123 deletions
|
|
@ -26,6 +26,7 @@
|
|||
#include <libcockatrice/protocol/pb/serverinfo_game.pb.h>
|
||||
#include <libcockatrice/protocol/pending_command.h>
|
||||
#include <libcockatrice/settings/cards_display_settings.h>
|
||||
#include <libcockatrice/settings/interface_settings.h>
|
||||
|
||||
GameSelector::GameSelector(AbstractClient *_client,
|
||||
TabSupervisor *_tabSupervisor,
|
||||
|
|
@ -83,12 +84,12 @@ GameSelector::GameSelector(AbstractClient *_client,
|
|||
if (showFilters && restoresettings) {
|
||||
quickFilterToolBar = new GameSelectorQuickFilterToolBar(this, tabSupervisor, gameListProxyModel, gameTypeMap);
|
||||
quickFilterToolBar->setVisible(showFilters && restoresettings &&
|
||||
SettingsCache::instance().cardsDisplay().getShowGameSelectorFilterToolbar());
|
||||
SettingsCache::instance().userInterface().getShowGameSelectorFilterToolbar());
|
||||
|
||||
connect(&SettingsCache::instance().cardsDisplay(), &CardsDisplaySettings::showGameSelectorFilterToolbarChanged,
|
||||
connect(&SettingsCache::instance().userInterface(), &InterfaceSettings::showGameSelectorFilterToolbarChanged,
|
||||
this, [this] {
|
||||
quickFilterToolBar->setVisible(
|
||||
SettingsCache::instance().cardsDisplay().getShowGameSelectorFilterToolbar());
|
||||
SettingsCache::instance().userInterface().getShowGameSelectorFilterToolbar());
|
||||
});
|
||||
} else {
|
||||
quickFilterToolBar = nullptr;
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@
|
|||
#include <libcockatrice/protocol/pb/response_get_games_of_user.pb.h>
|
||||
#include <libcockatrice/protocol/pb/response_get_user_info.pb.h>
|
||||
#include <libcockatrice/protocol/pending_command.h>
|
||||
#include <libcockatrice/settings/interface_settings.h>
|
||||
#include <libcockatrice/settings/appearance_settings.h>
|
||||
#include <libcockatrice/utility/string_limits.h>
|
||||
|
||||
BanDialog::BanDialog(const ServerInfo_User &info, QWidget *parent) : QDialog(parent)
|
||||
|
|
@ -349,7 +349,7 @@ bool UserListItemDelegate::editorEvent(QEvent *event,
|
|||
|
||||
QSize UserListItemDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
|
||||
{
|
||||
if (!SettingsCache::instance().interface().getStyleUserList()) {
|
||||
if (!SettingsCache::instance().appearance().getStyleUserList()) {
|
||||
return QStyledItemDelegate::sizeHint(option, index);
|
||||
}
|
||||
return UserListPainter::sizeHint();
|
||||
|
|
@ -357,7 +357,7 @@ QSize UserListItemDelegate::sizeHint(const QStyleOptionViewItem &option, const Q
|
|||
|
||||
void UserListItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
|
||||
{
|
||||
if (!SettingsCache::instance().interface().getStyleUserList()) {
|
||||
if (!SettingsCache::instance().appearance().getStyleUserList()) {
|
||||
QStyledItemDelegate::paint(painter, option, index);
|
||||
return;
|
||||
}
|
||||
|
|
@ -521,7 +521,7 @@ UserListWidget::UserListWidget(TabSupervisor *_tabSupervisor,
|
|||
|
||||
// Pin on item click
|
||||
connect(userTree, &QTreeWidget::itemClicked, this, [this](QTreeWidgetItem *item, int) {
|
||||
if (!SettingsCache::instance().interface().getStyleUserList()) {
|
||||
if (!SettingsCache::instance().appearance().getStyleUserList()) {
|
||||
return;
|
||||
}
|
||||
const QString name = static_cast<UserListTWI *>(item)->getUserInfo().name().c_str();
|
||||
|
|
@ -553,7 +553,7 @@ UserListWidget::UserListWidget(TabSupervisor *_tabSupervisor,
|
|||
connect(cardArtProvider, &UserCardArtProvider::cardArtUpdated, this,
|
||||
[this](const QString &) { userTree->viewport()->update(); });
|
||||
|
||||
connect(&SettingsCache::instance().interface(), &InterfaceSettings::styleUserListChanged, this,
|
||||
connect(&SettingsCache::instance().appearance(), &AppearanceSettings::styleUserListChanged, this,
|
||||
&UserListWidget::applyDisplayMode);
|
||||
applyDisplayMode();
|
||||
|
||||
|
|
@ -659,7 +659,7 @@ void UserListWidget::hideEvent(QHideEvent *e)
|
|||
|
||||
void UserListWidget::applyDisplayMode()
|
||||
{
|
||||
const bool styled = SettingsCache::instance().interface().getStyleUserList();
|
||||
const bool styled = SettingsCache::instance().appearance().getStyleUserList();
|
||||
|
||||
if (styled) {
|
||||
userTree->header()->setSectionResizeMode(0, QHeaderView::Stretch);
|
||||
|
|
@ -718,7 +718,7 @@ bool UserListWidget::eventFilter(QObject *obj, QEvent *event)
|
|||
{
|
||||
if (obj == userTree->viewport()) {
|
||||
if (event->type() == QEvent::MouseMove) {
|
||||
if (!SettingsCache::instance().interface().getStyleUserList()) {
|
||||
if (!SettingsCache::instance().appearance().getStyleUserList()) {
|
||||
return QGroupBox::eventFilter(obj, event);
|
||||
}
|
||||
auto *me = static_cast<QMouseEvent *>(event);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue