Adjust margins for control row buttons
This commit is contained in:
parent
694de8b223
commit
6408d90821
1 changed files with 17 additions and 5 deletions
|
@ -13,9 +13,12 @@ namespace SpritePacker.GUI
|
||||||
private static bool initialised = false;
|
private static bool initialised = false;
|
||||||
|
|
||||||
private SpriteListView spriteListDisplay;
|
private SpriteListView spriteListDisplay;
|
||||||
private FileChooserWidget spriteListSelector;
|
private FileChooserDialog spriteListSelector;
|
||||||
private FileFilter spriteListSelectorFilter;
|
private FileFilter spriteListSelectorFilter;
|
||||||
|
|
||||||
|
private Button openImageButton;
|
||||||
|
private Button removeImageButton;
|
||||||
|
|
||||||
public MainWindow() : base("SpritePacker GUI")
|
public MainWindow() : base("SpritePacker GUI")
|
||||||
{
|
{
|
||||||
if (!initialised)
|
if (!initialised)
|
||||||
|
@ -52,6 +55,7 @@ namespace SpritePacker.GUI
|
||||||
// Create the layout containers
|
// Create the layout containers
|
||||||
HBox masterContainer = new HBox(false, 10);
|
HBox masterContainer = new HBox(false, 10);
|
||||||
VBox leftPanel = new VBox(false, 0) { MarginRight = 5 };
|
VBox leftPanel = new VBox(false, 0) { MarginRight = 5 };
|
||||||
|
HBox controlButtonRow = new HBox();
|
||||||
VBox rightPanel = new VBox(false, 0) { MarginLeft = 5 };
|
VBox rightPanel = new VBox(false, 0) { MarginLeft = 5 };
|
||||||
Frame leftPanelFrame = new Frame("Sprites") { Child = leftPanel, Margin = 10, MarginRight = 5 };
|
Frame leftPanelFrame = new Frame("Sprites") { Child = leftPanel, Margin = 10, MarginRight = 5 };
|
||||||
Frame rightPanelFrame = new Frame("Preview") { Child = rightPanel, Margin = 10, MarginLeft = 5 };
|
Frame rightPanelFrame = new Frame("Preview") { Child = rightPanel, Margin = 10, MarginLeft = 5 };
|
||||||
|
@ -61,19 +65,27 @@ namespace SpritePacker.GUI
|
||||||
foreach (ImageCodecInfo currentDecoder in ImageCodecInfo.GetImageDecoders())
|
foreach (ImageCodecInfo currentDecoder in ImageCodecInfo.GetImageDecoders())
|
||||||
spriteListSelectorFilter.AddMimeType(currentDecoder.MimeType);
|
spriteListSelectorFilter.AddMimeType(currentDecoder.MimeType);
|
||||||
|
|
||||||
// Create the file selector
|
// Create the file selector dialog
|
||||||
spriteListSelector = new FileChooserWidget(FileChooserAction.Open) {
|
spriteListSelector = new FileChooserDialog("Add Sprite", this, FileChooserAction.Open) {
|
||||||
Margin = 10,
|
Margin = 10,
|
||||||
PreviewWidgetActive = true,
|
PreviewWidgetActive = true,
|
||||||
Filter = spriteListSelectorFilter
|
Filter = spriteListSelectorFilter
|
||||||
};
|
};
|
||||||
|
spriteListSelector.SelectMultiple = true;
|
||||||
|
|
||||||
// Create the ListView to display the added sprites
|
// Create the ListView to display the added sprites
|
||||||
spriteListDisplay = new SpriteListView() { Margin = 10 };
|
spriteListDisplay = new SpriteListView() { Margin = 10, MarginTop = 5 };
|
||||||
spriteListDisplay.AddItem(new Sprite("/home/sbrl/Pictures/Spaghetti.png"));
|
spriteListDisplay.AddItem(new Sprite("/home/sbrl/Pictures/Spaghetti.png"));
|
||||||
|
|
||||||
|
openImageButton = new Button("Add sprite") { Margin = 10, MarginTop = 0, MarginBottom = 0 };
|
||||||
|
removeImageButton = new Button("Remove Sprite") { Margin = 10, MarginTop = 0, MarginBottom = 0 };
|
||||||
|
|
||||||
|
// Populate the control button row
|
||||||
|
controlButtonRow.PackStart(removeImageButton, true, false, 0);
|
||||||
|
controlButtonRow.PackStart(openImageButton, true, false, 0);
|
||||||
|
|
||||||
// Populate the left panel
|
// Populate the left panel
|
||||||
leftPanel.PackStart(spriteListSelector, true, true, 0);
|
leftPanel.PackStart(controlButtonRow, false, false, 5);
|
||||||
leftPanel.PackStart(spriteListDisplay, true, true, 0);
|
leftPanel.PackStart(spriteListDisplay, true, true, 0);
|
||||||
|
|
||||||
// Pack the master container
|
// Pack the master container
|
||||||
|
|
Loading…
Reference in a new issue