Browse Source

Adjust margins for control row buttons

tags/v0.1
Starbeamrainbowlabs 3 years ago
parent
commit
6408d90821
1 changed files with 17 additions and 5 deletions
  1. 17
    5
      SpritePacker-GUI/MainWindow.cs

+ 17
- 5
SpritePacker-GUI/MainWindow.cs View File

@@ -13,9 +13,12 @@ namespace SpritePacker.GUI
private static bool initialised = false;

private SpriteListView spriteListDisplay;
private FileChooserWidget spriteListSelector;
private FileChooserDialog spriteListSelector;
private FileFilter spriteListSelectorFilter;

private Button openImageButton;
private Button removeImageButton;

public MainWindow() : base("SpritePacker GUI")
{
if (!initialised)
@@ -52,6 +55,7 @@ namespace SpritePacker.GUI
// Create the layout containers
HBox masterContainer = new HBox(false, 10);
VBox leftPanel = new VBox(false, 0) { MarginRight = 5 };
HBox controlButtonRow = new HBox();
VBox rightPanel = new VBox(false, 0) { MarginLeft = 5 };
Frame leftPanelFrame = new Frame("Sprites") { Child = leftPanel, Margin = 10, MarginRight = 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())
spriteListSelectorFilter.AddMimeType(currentDecoder.MimeType);

// Create the file selector
spriteListSelector = new FileChooserWidget(FileChooserAction.Open) {
// Create the file selector dialog
spriteListSelector = new FileChooserDialog("Add Sprite", this, FileChooserAction.Open) {
Margin = 10,
PreviewWidgetActive = true,
Filter = spriteListSelectorFilter
};
spriteListSelector.SelectMultiple = true;

// 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"));

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
leftPanel.PackStart(spriteListSelector, true, true, 0);
leftPanel.PackStart(controlButtonRow, false, false, 5);
leftPanel.PackStart(spriteListDisplay, true, true, 0);

// Pack the master container

Loading…
Cancel
Save