mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-19 00:42:14 -07:00
Revert resizing.
This commit is contained in:
parent
a5f84d7e2c
commit
c9195d211d
4 changed files with 5 additions and 14 deletions
|
|
@ -14,7 +14,7 @@ BannerWidget::BannerWidget(QWidget *parent, const QString &text, Qt::Orientation
|
||||||
bannerLabel->setStyleSheet("font-size: 24px; font-weight: bold; color: white;");
|
bannerLabel->setStyleSheet("font-size: 24px; font-weight: bold; color: white;");
|
||||||
|
|
||||||
// Layout to center the banner label
|
// Layout to center the banner label
|
||||||
QVBoxLayout *layout = new QVBoxLayout(this);
|
layout = new QVBoxLayout(this);
|
||||||
layout->addWidget(bannerLabel);
|
layout->addWidget(bannerLabel);
|
||||||
setLayout(layout);
|
setLayout(layout);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
#define BANNER_WIDGET_H
|
#define BANNER_WIDGET_H
|
||||||
|
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
|
#include <QVBoxLayout>
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
|
||||||
class BannerWidget : public QWidget
|
class BannerWidget : public QWidget
|
||||||
|
|
@ -32,6 +33,7 @@ protected:
|
||||||
void paintEvent(QPaintEvent *event) override;
|
void paintEvent(QPaintEvent *event) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
QVBoxLayout *layout;
|
||||||
QLabel *bannerLabel;
|
QLabel *bannerLabel;
|
||||||
Qt::Orientation gradientOrientation;
|
Qt::Orientation gradientOrientation;
|
||||||
int transparency; // Transparency percentage for the gradient
|
int transparency; // Transparency percentage for the gradient
|
||||||
|
|
|
||||||
|
|
@ -18,12 +18,12 @@ VisualDeckStorageWidget::VisualDeckStorageWidget(QWidget *parent) : QWidget(pare
|
||||||
deckListModel = new DeckListModel(this);
|
deckListModel = new DeckListModel(this);
|
||||||
deckListModel->setObjectName("visualDeckModel");
|
deckListModel->setObjectName("visualDeckModel");
|
||||||
|
|
||||||
layout = new QVBoxLayout();
|
layout = new QVBoxLayout(this);
|
||||||
layout->setSpacing(0);
|
layout->setSpacing(0);
|
||||||
layout->setContentsMargins(9, 0, 9, 5);
|
layout->setContentsMargins(9, 0, 9, 5);
|
||||||
setLayout(layout);
|
setLayout(layout);
|
||||||
|
|
||||||
searchAndSortLayout = new QHBoxLayout();
|
searchAndSortLayout = new QHBoxLayout(this);
|
||||||
searchAndSortLayout->setSpacing(3);
|
searchAndSortLayout->setSpacing(3);
|
||||||
searchAndSortLayout->setContentsMargins(9, 0, 9, 0);
|
searchAndSortLayout->setContentsMargins(9, 0, 9, 0);
|
||||||
|
|
||||||
|
|
@ -44,7 +44,6 @@ VisualDeckStorageWidget::VisualDeckStorageWidget(QWidget *parent) : QWidget(pare
|
||||||
scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||||
|
|
||||||
folderWidget = new VisualDeckStorageFolderDisplayWidget(this, this, SettingsCache::instance().getDeckPath(), false);
|
folderWidget = new VisualDeckStorageFolderDisplayWidget(this, this, SettingsCache::instance().getDeckPath(), false);
|
||||||
folderWidget->setFixedWidth(scrollArea->viewport()->width());
|
|
||||||
|
|
||||||
scrollArea->setWidget(folderWidget);
|
scrollArea->setWidget(folderWidget);
|
||||||
scrollArea->setWidgetResizable(true);
|
scrollArea->setWidgetResizable(true);
|
||||||
|
|
@ -70,14 +69,6 @@ VisualDeckStorageWidget::VisualDeckStorageWidget(QWidget *parent) : QWidget(pare
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void VisualDeckStorageWidget::resizeEvent(QResizeEvent *event)
|
|
||||||
{
|
|
||||||
QWidget::resizeEvent(event);
|
|
||||||
if (scrollArea->widget() == folderWidget) {
|
|
||||||
folderWidget->setFixedWidth(scrollArea->viewport()->width());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void VisualDeckStorageWidget::retranslateUi()
|
void VisualDeckStorageWidget::retranslateUi()
|
||||||
{
|
{
|
||||||
databaseLoadIndicator->setText(tr("Loading database ..."));
|
databaseLoadIndicator->setText(tr("Loading database ..."));
|
||||||
|
|
@ -97,7 +88,6 @@ void VisualDeckStorageWidget::deckPreviewDoubleClickedEvent(QMouseEvent *event,
|
||||||
void VisualDeckStorageWidget::refreshBannerCards()
|
void VisualDeckStorageWidget::refreshBannerCards()
|
||||||
{
|
{
|
||||||
folderWidget = new VisualDeckStorageFolderDisplayWidget(this, this, SettingsCache::instance().getDeckPath(), false);
|
folderWidget = new VisualDeckStorageFolderDisplayWidget(this, this, SettingsCache::instance().getDeckPath(), false);
|
||||||
folderWidget->setFixedWidth(scrollArea->viewport()->width());
|
|
||||||
scrollArea->setWidget(folderWidget);
|
scrollArea->setWidget(folderWidget);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,6 @@ public slots:
|
||||||
void updateColorFilter();
|
void updateColorFilter();
|
||||||
void updateSearchFilter();
|
void updateSearchFilter();
|
||||||
void updateSortOrder();
|
void updateSortOrder();
|
||||||
void resizeEvent(QResizeEvent *event) override;
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void bannerCardsRefreshed();
|
void bannerCardsRefreshed();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue