fix palettes item list wrapping
This commit is contained in:
@@ -38,6 +38,7 @@ namespace Noggit
|
|||||||
setSelectionMode(QAbstractItemView::SingleSelection);
|
setSelectionMode(QAbstractItemView::SingleSelection);
|
||||||
setAcceptDrops(false);
|
setAcceptDrops(false);
|
||||||
setMovement(Movement::Static);
|
setMovement(Movement::Static);
|
||||||
|
setResizeMode(QListView::Adjust);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ObjectList::mousePressEvent(QMouseEvent* event)
|
void ObjectList::mousePressEvent(QMouseEvent* event)
|
||||||
@@ -109,11 +110,13 @@ namespace Noggit
|
|||||||
QVBoxLayout* button_layout = new QVBoxLayout(this);
|
QVBoxLayout* button_layout = new QVBoxLayout(this);
|
||||||
|
|
||||||
_add_button = new QPushButton(this);
|
_add_button = new QPushButton(this);
|
||||||
|
_add_button->setToolTip("Add from Asset Browser");
|
||||||
_add_button->setIcon(FontAwesomeIcon(FontAwesome::plus));
|
_add_button->setIcon(FontAwesomeIcon(FontAwesome::plus));
|
||||||
button_layout->addWidget(_add_button);
|
button_layout->addWidget(_add_button);
|
||||||
connect(_add_button, &QAbstractButton::clicked, this, &ObjectPalette::addObjectFromAssetBrowser);
|
connect(_add_button, &QAbstractButton::clicked, this, &ObjectPalette::addObjectFromAssetBrowser);
|
||||||
|
|
||||||
_remove_button = new QPushButton(this);
|
_remove_button = new QPushButton(this);
|
||||||
|
_remove_button->setToolTip("Remove selected Object");
|
||||||
_remove_button->setIcon(FontAwesomeIcon(FontAwesome::times));
|
_remove_button->setIcon(FontAwesomeIcon(FontAwesome::times));
|
||||||
button_layout->addWidget(_remove_button);
|
button_layout->addWidget(_remove_button);
|
||||||
connect(_remove_button, &QAbstractButton::clicked, this, &ObjectPalette::removeSelectedTexture);
|
connect(_remove_button, &QAbstractButton::clicked, this, &ObjectPalette::removeSelectedTexture);
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ namespace Noggit
|
|||||||
|
|
||||||
QGridLayout* layout;
|
QGridLayout* layout;
|
||||||
|
|
||||||
QListWidget* _object_list;
|
ObjectList* _object_list;
|
||||||
QPushButton* _add_button;
|
QPushButton* _add_button;
|
||||||
QPushButton* _remove_button;
|
QPushButton* _remove_button;
|
||||||
std::unordered_set<std::string> _object_paths;
|
std::unordered_set<std::string> _object_paths;
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ namespace Noggit
|
|||||||
setSelectionMode(QAbstractItemView::SingleSelection);
|
setSelectionMode(QAbstractItemView::SingleSelection);
|
||||||
setAcceptDrops(false);
|
setAcceptDrops(false);
|
||||||
setMovement(Movement::Static);
|
setMovement(Movement::Static);
|
||||||
|
setResizeMode(QListView::Adjust);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PaletteList::mousePressEvent(QMouseEvent* event)
|
void PaletteList::mousePressEvent(QMouseEvent* event)
|
||||||
@@ -102,6 +103,7 @@ namespace Noggit
|
|||||||
QVBoxLayout* button_layout = new QVBoxLayout(this);
|
QVBoxLayout* button_layout = new QVBoxLayout(this);
|
||||||
|
|
||||||
_add_button = new QPushButton(this);
|
_add_button = new QPushButton(this);
|
||||||
|
_add_button->setToolTip("Add Selected Texture");
|
||||||
_add_button->setIcon(FontAwesomeIcon(FontAwesome::plus));
|
_add_button->setIcon(FontAwesomeIcon(FontAwesome::plus));
|
||||||
button_layout->addWidget(_add_button);
|
button_layout->addWidget(_add_button);
|
||||||
connect(_add_button, &QAbstractButton::clicked, this, &texture_palette_small::addTexture);
|
connect(_add_button, &QAbstractButton::clicked, this, &texture_palette_small::addTexture);
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ namespace Noggit
|
|||||||
|
|
||||||
QGridLayout* layout;
|
QGridLayout* layout;
|
||||||
|
|
||||||
QListWidget* _texture_list;
|
PaletteList* _texture_list;
|
||||||
QPushButton* _add_button;
|
QPushButton* _add_button;
|
||||||
QPushButton* _remove_button;
|
QPushButton* _remove_button;
|
||||||
std::unordered_set<std::string> _texture_paths;
|
std::unordered_set<std::string> _texture_paths;
|
||||||
|
|||||||
Reference in New Issue
Block a user