mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-18 00:12: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());
|
||||
} else if (tabServer) {
|
||||
setCurrentWidget(tabServer);
|
||||
} else {
|
||||
openTabServer();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -65,8 +65,10 @@ CardInfoPictureWidget::CardInfoPictureWidget(QWidget *parent, const bool _hoverT
|
|||
|
||||
CardInfoPictureWidget::~CardInfoPictureWidget()
|
||||
{
|
||||
enlargedPixmapWidget->hide();
|
||||
enlargedPixmapWidget->deleteLater();
|
||||
if (enlargedPixmapWidget) {
|
||||
enlargedPixmapWidget->hide();
|
||||
enlargedPixmapWidget->deleteLater();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ private:
|
|||
bool hoverToZoomEnabled;
|
||||
bool raiseOnEnter;
|
||||
int hoverActivateThresholdInMs = 500;
|
||||
CardInfoPictureEnlargedWidget *enlargedPixmapWidget;
|
||||
CardInfoPictureEnlargedWidget *enlargedPixmapWidget = nullptr;
|
||||
int enlargedPixmapOffset = 10;
|
||||
QTimer *hoverTimer;
|
||||
QPropertyAnimation *animation;
|
||||
|
|
|
|||
|
|
@ -41,6 +41,8 @@ HomeWidget::HomeWidget(QWidget *parent, TabSupervisor *_tabSupervisor)
|
|||
|
||||
initializeBackgroundFromSource();
|
||||
|
||||
updateConnectButton(tabSupervisor->getClient()->getStatus());
|
||||
|
||||
connect(tabSupervisor->getClient(), &RemoteClient::statusChanged, this, &HomeWidget::updateConnectButton);
|
||||
connect(&SettingsCache::instance(), &SettingsCache::homeTabBackgroundSourceChanged, this,
|
||||
&HomeWidget::initializeBackgroundFromSource);
|
||||
|
|
@ -194,7 +196,7 @@ QGroupBox *HomeWidget::createButtons()
|
|||
|
||||
void HomeWidget::updateConnectButton(const ClientStatus status)
|
||||
{
|
||||
disconnect(connectButton);
|
||||
connectButton->disconnect();
|
||||
switch (status) {
|
||||
case StatusConnecting:
|
||||
connectButton->setText(tr("Connecting..."));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue