mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-18 08:22:15 -07:00
Initialize connect button, open server tab if no tab found, nullptr enlargedPixmapWidget
Took 7 minutes
This commit is contained in:
parent
494821df83
commit
af9924a278
4 changed files with 10 additions and 4 deletions
|
|
@ -746,6 +746,8 @@ void TabSupervisor::switchToFirstAvailableNetworkTab()
|
||||||
setCurrentWidget(roomTabs.first());
|
setCurrentWidget(roomTabs.first());
|
||||||
} else if (tabServer) {
|
} else if (tabServer) {
|
||||||
setCurrentWidget(tabServer);
|
setCurrentWidget(tabServer);
|
||||||
|
} else {
|
||||||
|
openTabServer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -65,8 +65,10 @@ CardInfoPictureWidget::CardInfoPictureWidget(QWidget *parent, const bool _hoverT
|
||||||
|
|
||||||
CardInfoPictureWidget::~CardInfoPictureWidget()
|
CardInfoPictureWidget::~CardInfoPictureWidget()
|
||||||
{
|
{
|
||||||
enlargedPixmapWidget->hide();
|
if (enlargedPixmapWidget) {
|
||||||
enlargedPixmapWidget->deleteLater();
|
enlargedPixmapWidget->hide();
|
||||||
|
enlargedPixmapWidget->deleteLater();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,7 @@ private:
|
||||||
bool hoverToZoomEnabled;
|
bool hoverToZoomEnabled;
|
||||||
bool raiseOnEnter;
|
bool raiseOnEnter;
|
||||||
int hoverActivateThresholdInMs = 500;
|
int hoverActivateThresholdInMs = 500;
|
||||||
CardInfoPictureEnlargedWidget *enlargedPixmapWidget;
|
CardInfoPictureEnlargedWidget *enlargedPixmapWidget = nullptr;
|
||||||
int enlargedPixmapOffset = 10;
|
int enlargedPixmapOffset = 10;
|
||||||
QTimer *hoverTimer;
|
QTimer *hoverTimer;
|
||||||
QPropertyAnimation *animation;
|
QPropertyAnimation *animation;
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,8 @@ HomeWidget::HomeWidget(QWidget *parent, TabSupervisor *_tabSupervisor)
|
||||||
|
|
||||||
initializeBackgroundFromSource();
|
initializeBackgroundFromSource();
|
||||||
|
|
||||||
|
updateConnectButton(tabSupervisor->getClient()->getStatus());
|
||||||
|
|
||||||
connect(tabSupervisor->getClient(), &RemoteClient::statusChanged, this, &HomeWidget::updateConnectButton);
|
connect(tabSupervisor->getClient(), &RemoteClient::statusChanged, this, &HomeWidget::updateConnectButton);
|
||||||
connect(&SettingsCache::instance(), &SettingsCache::homeTabBackgroundSourceChanged, this,
|
connect(&SettingsCache::instance(), &SettingsCache::homeTabBackgroundSourceChanged, this,
|
||||||
&HomeWidget::initializeBackgroundFromSource);
|
&HomeWidget::initializeBackgroundFromSource);
|
||||||
|
|
@ -194,7 +196,7 @@ QGroupBox *HomeWidget::createButtons()
|
||||||
|
|
||||||
void HomeWidget::updateConnectButton(const ClientStatus status)
|
void HomeWidget::updateConnectButton(const ClientStatus status)
|
||||||
{
|
{
|
||||||
disconnect(connectButton);
|
connectButton->disconnect();
|
||||||
switch (status) {
|
switch (status) {
|
||||||
case StatusConnecting:
|
case StatusConnecting:
|
||||||
connectButton->setText(tr("Connecting..."));
|
connectButton->setText(tr("Connecting..."));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue