abolished economical layout, improved stacking
This commit is contained in:
parent
feb1dac1e1
commit
a77dc1ff8c
6 changed files with 11 additions and 27 deletions
|
@ -228,17 +228,12 @@ AppearanceSettingsPage::AppearanceSettingsPage()
|
|||
handGroupBox = new QGroupBox;
|
||||
handGroupBox->setLayout(handGrid);
|
||||
|
||||
economicalGridCheckBox = new QCheckBox;
|
||||
economicalGridCheckBox->setChecked(settingsCache->getEconomicalGrid());
|
||||
connect(economicalGridCheckBox, SIGNAL(stateChanged(int)), settingsCache, SLOT(setEconomicalGrid(int)));
|
||||
|
||||
invertVerticalCoordinateCheckBox = new QCheckBox;
|
||||
invertVerticalCoordinateCheckBox->setChecked(settingsCache->getInvertVerticalCoordinate());
|
||||
connect(invertVerticalCoordinateCheckBox, SIGNAL(stateChanged(int)), settingsCache, SLOT(setInvertVerticalCoordinate(int)));
|
||||
|
||||
QGridLayout *tableGrid = new QGridLayout;
|
||||
tableGrid->addWidget(economicalGridCheckBox, 0, 0, 1, 2);
|
||||
tableGrid->addWidget(invertVerticalCoordinateCheckBox, 1, 0, 1, 2);
|
||||
tableGrid->addWidget(invertVerticalCoordinateCheckBox, 0, 0, 1, 2);
|
||||
|
||||
tableGroupBox = new QGroupBox;
|
||||
tableGroupBox->setLayout(tableGrid);
|
||||
|
@ -279,7 +274,6 @@ void AppearanceSettingsPage::retranslateUi()
|
|||
horizontalHandCheckBox->setText(tr("Display hand horizontally (wastes space)"));
|
||||
|
||||
tableGroupBox->setTitle(tr("Table grid layout"));
|
||||
economicalGridCheckBox->setText(tr("Economical layout"));
|
||||
invertVerticalCoordinateCheckBox->setText(tr("Invert vertical coordinate"));
|
||||
|
||||
zoneViewGroupBox->setTitle(tr("Zone view layout"));
|
||||
|
|
|
@ -67,7 +67,7 @@ signals:
|
|||
private:
|
||||
QLabel *handBgLabel, *stackBgLabel, *tableBgLabel, *playerAreaBgLabel, *cardBackPicturePathLabel;
|
||||
QLineEdit *handBgEdit, *stackBgEdit, *tableBgEdit, *playerAreaBgEdit, *cardBackPicturePathEdit;
|
||||
QCheckBox *horizontalHandCheckBox, *economicalGridCheckBox, *invertVerticalCoordinateCheckBox, *zoneViewSortByNameCheckBox, *zoneViewSortByTypeCheckBox;
|
||||
QCheckBox *horizontalHandCheckBox, *invertVerticalCoordinateCheckBox, *zoneViewSortByNameCheckBox, *zoneViewSortByTypeCheckBox;
|
||||
QGroupBox *zoneBgGroupBox, *handGroupBox, *tableGroupBox, *zoneViewGroupBox;
|
||||
public:
|
||||
AppearanceSettingsPage();
|
||||
|
|
|
@ -21,7 +21,6 @@ SettingsCache::SettingsCache()
|
|||
doubleClickToPlay = settings->value("interface/doubleclicktoplay", true).toBool();
|
||||
cardInfoMinimized = settings->value("interface/cardinfominimized", false).toBool();
|
||||
horizontalHand = settings->value("hand/horizontal", true).toBool();
|
||||
economicalGrid = settings->value("table/economic", false).toBool();
|
||||
invertVerticalCoordinate = settings->value("table/invert_vertical", false).toBool();
|
||||
tapAnimation = settings->value("cards/tapanimation", true).toBool();
|
||||
|
||||
|
@ -117,13 +116,6 @@ void SettingsCache::setHorizontalHand(int _horizontalHand)
|
|||
emit horizontalHandChanged();
|
||||
}
|
||||
|
||||
void SettingsCache::setEconomicalGrid(int _economicalGrid)
|
||||
{
|
||||
economicalGrid = _economicalGrid;
|
||||
settings->setValue("table/economic", economicalGrid);
|
||||
emit economicalGridChanged();
|
||||
}
|
||||
|
||||
void SettingsCache::setInvertVerticalCoordinate(int _invertVerticalCoordinate)
|
||||
{
|
||||
invertVerticalCoordinate = _invertVerticalCoordinate;
|
||||
|
|
|
@ -18,7 +18,6 @@ signals:
|
|||
void cardBackPicturePathChanged();
|
||||
void picDownloadChanged();
|
||||
void horizontalHandChanged();
|
||||
void economicalGridChanged();
|
||||
void invertVerticalCoordinateChanged();
|
||||
private:
|
||||
QSettings *settings;
|
||||
|
@ -30,7 +29,6 @@ private:
|
|||
bool doubleClickToPlay;
|
||||
bool cardInfoMinimized;
|
||||
bool horizontalHand;
|
||||
bool economicalGrid;
|
||||
bool invertVerticalCoordinate;
|
||||
bool tapAnimation;
|
||||
bool zoneViewSortByName, zoneViewSortByType;
|
||||
|
@ -49,7 +47,6 @@ public:
|
|||
bool getDoubleClickToPlay() const { return doubleClickToPlay; }
|
||||
bool getCardInfoMinimized() const { return cardInfoMinimized; }
|
||||
bool getHorizontalHand() const { return horizontalHand; }
|
||||
bool getEconomicalGrid() const { return economicalGrid; }
|
||||
bool getInvertVerticalCoordinate() const { return invertVerticalCoordinate; }
|
||||
bool getTapAnimation() const { return tapAnimation; }
|
||||
bool getZoneViewSortByName() const { return zoneViewSortByName; }
|
||||
|
@ -68,7 +65,6 @@ public slots:
|
|||
void setDoubleClickToPlay(int _doubleClickToPlay);
|
||||
void setCardInfoMinimized(bool _cardInfoMinimized);
|
||||
void setHorizontalHand(int _horizontalHand);
|
||||
void setEconomicalGrid(int _economicalGrid);
|
||||
void setInvertVerticalCoordinate(int _invertVerticalCoordinate);
|
||||
void setTapAnimation(int _tapAnimation);
|
||||
void setZoneViewSortByName(int _zoneViewSortByName);
|
||||
|
|
|
@ -12,13 +12,9 @@ TableZone::TableZone(Player *_p, QGraphicsItem *parent)
|
|||
: SelectZone(_p, "table", true, false, true, parent), active(false)
|
||||
{
|
||||
connect(settingsCache, SIGNAL(tableBgPathChanged()), this, SLOT(updateBgPixmap()));
|
||||
connect(settingsCache, SIGNAL(economicalGridChanged()), this, SLOT(reorganizeCards()));
|
||||
connect(settingsCache, SIGNAL(invertVerticalCoordinateChanged()), this, SLOT(reorganizeCards()));
|
||||
updateBgPixmap();
|
||||
|
||||
if (settingsCache->getEconomicalGrid())
|
||||
height = 2 * boxLineWidth + (int) (11.0 / 3 * CARD_HEIGHT + 2 * paddingY);
|
||||
else
|
||||
height = 2 * boxLineWidth + 3 * (CARD_HEIGHT + 20) + 2 * paddingY;
|
||||
width = minWidth + 2 * marginX + 2 * boxLineWidth;
|
||||
currentMinimumWidth = minWidth;
|
||||
|
@ -276,7 +272,13 @@ QPoint TableZone::mapToGrid(const QPointF &mapPoint) const
|
|||
|
||||
QPointF TableZone::closestGridPoint(const QPointF &point)
|
||||
{
|
||||
return mapFromGrid(mapToGrid(point + QPoint(1, 1)));
|
||||
QPoint gridPoint = mapToGrid(point + QPoint(1, 1));
|
||||
gridPoint.setX((gridPoint.x() / 3) * 3);
|
||||
if (getCardFromGrid(gridPoint))
|
||||
gridPoint.setX(gridPoint.x() + 1);
|
||||
if (getCardFromGrid(gridPoint))
|
||||
gridPoint.setX(gridPoint.x() + 1);
|
||||
return mapFromGrid(gridPoint);
|
||||
}
|
||||
|
||||
void TableZone::setWidth(qreal _width)
|
||||
|
|
|
@ -9,7 +9,7 @@ signals:
|
|||
void sizeChanged();
|
||||
private:
|
||||
static const int boxLineWidth = 10;
|
||||
static const int paddingX = 20;
|
||||
static const int paddingX = 35;
|
||||
static const int paddingY = 10;
|
||||
static const int marginX = 20;
|
||||
static const int minWidth = 15 * CARD_WIDTH / 2;
|
||||
|
|
Loading…
Reference in a new issue