mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-10 16:24:45 -07:00
Redesigning deck editor to work with docks
Moved setting files & Added code for a future portable build
This commit is contained in:
parent
ba90d84a13
commit
e9e75961f4
11 changed files with 485 additions and 123 deletions
|
|
@ -7,39 +7,52 @@
|
|||
#include "cardinfotext.h"
|
||||
#include "settingscache.h"
|
||||
|
||||
#include <QSplitter>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
CardFrame::CardFrame(int width, int height, const QString &cardName, QWidget *parent)
|
||||
CardFrame::CardFrame(const QString &cardName, QWidget *parent)
|
||||
: QTabWidget(parent), info(0), cardTextOnly(false)
|
||||
{
|
||||
setFixedWidth(width);
|
||||
setMinimumHeight(height);
|
||||
|
||||
setContentsMargins(3, 3, 3, 3);
|
||||
pic = new CardInfoPicture(width - 6);
|
||||
pic = new CardInfoPicture();
|
||||
pic->setObjectName("pic");
|
||||
text = new CardInfoText();
|
||||
text->setObjectName("text");
|
||||
|
||||
tab1 = new QWidget(this);
|
||||
tab2 = new QWidget(this);
|
||||
tab3 = new QWidget(this);
|
||||
|
||||
tab1->setObjectName("tab1");
|
||||
tab2->setObjectName("tab2");
|
||||
tab3->setObjectName("tab3");
|
||||
|
||||
insertTab(ImageOnlyView, tab1, QString());
|
||||
insertTab(TextOnlyView, tab2, QString());
|
||||
insertTab(ImageAndTextView, tab3, QString());
|
||||
connect(this, SIGNAL(currentChanged(int)), this, SLOT(setViewMode(int)));
|
||||
|
||||
tab1Layout = new QVBoxLayout();
|
||||
tab1Layout->setObjectName("tab1Layout");
|
||||
tab1Layout->setContentsMargins(0, 0, 0, 0);
|
||||
tab1Layout->setSpacing(0);
|
||||
tab1->setLayout(tab1Layout);
|
||||
|
||||
tab2Layout = new QVBoxLayout();
|
||||
tab2Layout->setObjectName("tab2Layout");
|
||||
tab2Layout->setContentsMargins(0, 0, 0, 0);
|
||||
tab2Layout->setSpacing(0);
|
||||
tab2->setLayout(tab2Layout);
|
||||
|
||||
splitter = new QSplitter();
|
||||
splitter->setObjectName("splitter");
|
||||
splitter->setOrientation(Qt::Vertical);
|
||||
|
||||
tab3Layout = new QVBoxLayout();
|
||||
tab3Layout->setObjectName("tab3Layout");
|
||||
tab3Layout->setContentsMargins(0, 0, 0, 0);
|
||||
tab3Layout->setSpacing(0);
|
||||
tab3Layout->addWidget(splitter);
|
||||
tab3->setLayout(tab3Layout);
|
||||
|
||||
setViewMode(settingsCache->getCardInfoViewMode());
|
||||
|
|
@ -67,8 +80,8 @@ void CardFrame::setViewMode(int mode)
|
|||
tab2Layout->addWidget(text);
|
||||
break;
|
||||
case ImageAndTextView:
|
||||
tab3Layout->addWidget(pic);
|
||||
tab3Layout->addWidget(text);
|
||||
splitter->addWidget(pic);
|
||||
splitter->addWidget(text);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue