mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 21:06:59 -04:00
Resize list of stylesheets to fit available space
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1138 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -100,3 +100,7 @@ void PackageList::select(const String& name, bool send_event) {
|
||||
update();
|
||||
return;
|
||||
}
|
||||
|
||||
int PackageList::requiredWidth() const {
|
||||
return (item_size.x + SPACING) * (int)itemCount();
|
||||
}
|
||||
|
||||
@@ -48,11 +48,15 @@ class PackageList : public GalleryList {
|
||||
/// Select the package with the given name, if it is not found, selects nothing
|
||||
void select(const String& name, bool send_event = true);
|
||||
|
||||
/// Required width to show all items
|
||||
int requiredWidth() const;
|
||||
using GalleryList::column_count;
|
||||
|
||||
protected:
|
||||
/// Return how many items there are in the list
|
||||
virtual size_t itemCount() const;
|
||||
/// Draw an item
|
||||
virtual void drawItem(DC& dc, int x, int y, size_t item);
|
||||
/// Return how many items there are in the list
|
||||
virtual size_t itemCount() const;
|
||||
|
||||
private:
|
||||
// The default icon to use
|
||||
|
||||
Reference in New Issue
Block a user