Further fix KDM dialog Z-order on OS X (#979).
[dcpomatic.git] / src / wx / screens_panel.cc
index 0638763fe364ce0743b05320d070819ad8674be4..6643632642b0ff6b6dd223e7621f4e0d2c6f8b80 100644 (file)
@@ -52,20 +52,20 @@ ScreensPanel::ScreensPanel (wxWindow* parent)
 
        add_cinemas ();
 
-       wxGridSizer* target_buttons = new wxGridSizer (2, DCPOMATIC_BUTTON_STACK_GAP * 2, DCPOMATIC_SIZER_Y_GAP);
+       wxBoxSizer* target_buttons = new wxBoxSizer (wxVERTICAL);
 
        _add_cinema = new wxButton (this, wxID_ANY, _("Add Cinema..."));
-       target_buttons->Add (_add_cinema, 1, wxEXPAND);
-       _add_screen = new wxButton (this, wxID_ANY, _("Add Screen..."));
-       target_buttons->Add (_add_screen, 1, wxEXPAND);
+       target_buttons->Add (_add_cinema, 1, wxEXPAND | wxBOTTOM, DCPOMATIC_BUTTON_STACK_GAP);
        _edit_cinema = new wxButton (this, wxID_ANY, _("Edit Cinema..."));
-       target_buttons->Add (_edit_cinema, 1, wxEXPAND);
-       _edit_screen = new wxButton (this, wxID_ANY, _("Edit Screen..."));
-       target_buttons->Add (_edit_screen, 1, wxEXPAND);
+       target_buttons->Add (_edit_cinema, 1, wxEXPAND | wxBOTTOM, DCPOMATIC_BUTTON_STACK_GAP);
        _remove_cinema = new wxButton (this, wxID_ANY, _("Remove Cinema"));
-       target_buttons->Add (_remove_cinema, 1, wxEXPAND);
+       target_buttons->Add (_remove_cinema, 1, wxEXPAND | wxBOTTOM, DCPOMATIC_BUTTON_STACK_GAP);
+       _add_screen = new wxButton (this, wxID_ANY, _("Add Screen..."));
+       target_buttons->Add (_add_screen, 1, wxEXPAND | wxBOTTOM, DCPOMATIC_BUTTON_STACK_GAP);
+       _edit_screen = new wxButton (this, wxID_ANY, _("Edit Screen..."));
+       target_buttons->Add (_edit_screen, 1, wxEXPAND | wxBOTTOM, DCPOMATIC_BUTTON_STACK_GAP);
        _remove_screen = new wxButton (this, wxID_ANY, _("Remove Screen"));
-       target_buttons->Add (_remove_screen, 1, wxEXPAND);
+       target_buttons->Add (_remove_screen, 1, wxEXPAND | wxBOTTOM, DCPOMATIC_BUTTON_STACK_GAP);
 
        targets->Add (target_buttons, 0, 0);
 
@@ -147,7 +147,7 @@ ScreensPanel::add_screen (shared_ptr<Cinema> c, shared_ptr<Screen> s)
 void
 ScreensPanel::add_cinema_clicked ()
 {
-       CinemaDialog* d = new CinemaDialog (this, _("Add Cinema"));
+       CinemaDialog* d = new CinemaDialog (GetParent(), _("Add Cinema"));
        if (d->ShowModal () == wxID_OK) {
                shared_ptr<Cinema> c (new Cinema (d->name(), d->emails(), d->notes(), d->utc_offset_hour(), d->utc_offset_minute()));
                Config::instance()->add_cinema (c);
@@ -167,7 +167,7 @@ ScreensPanel::edit_cinema_clicked ()
        pair<wxTreeItemId, shared_ptr<Cinema> > c = *_selected_cinemas.begin();
 
        CinemaDialog* d = new CinemaDialog (
-               this, _("Edit cinema"), c.second->name, c.second->emails, c.second->notes, c.second->utc_offset_hour(), c.second->utc_offset_minute()
+               GetParent(), _("Edit cinema"), c.second->name, c.second->emails, c.second->notes, c.second->utc_offset_hour(), c.second->utc_offset_minute()
                );
 
        if (d->ShowModal () == wxID_OK) {
@@ -203,7 +203,7 @@ ScreensPanel::add_screen_clicked ()
 
        shared_ptr<Cinema> c = _selected_cinemas.begin()->second;
 
-       ScreenDialog* d = new ScreenDialog (this, _("Add Screen"));
+       ScreenDialog* d = new ScreenDialog (GetParent(), _("Add Screen"));
        if (d->ShowModal () != wxID_OK) {
                return;
        }
@@ -229,7 +229,7 @@ ScreensPanel::edit_screen_clicked ()
 
        pair<wxTreeItemId, shared_ptr<Screen> > s = *_selected_screens.begin();
 
-       ScreenDialog* d = new ScreenDialog (this, _("Edit screen"), s.second->name, s.second->notes, s.second->recipient, s.second->trusted_devices);
+       ScreenDialog* d = new ScreenDialog (GetParent(), _("Edit screen"), s.second->name, s.second->notes, s.second->recipient, s.second->trusted_devices);
        if (d->ShowModal () == wxID_OK) {
                s.second->name = d->name ();
                s.second->notes = d->notes ();