Skip to content

Commit a7d906b

Browse files
committed
Database: Toplevel is now a window instead of a dialog
1 parent 841f941 commit a7d906b

File tree

2 files changed

+21
-11
lines changed

2 files changed

+21
-11
lines changed

src/app.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,7 @@ def on_rtp
132132
end
133133
def on_database
134134
return unless has_project?
135-
database = DatabaseDialog.new(@window)
136-
database.run
137-
database.destroy
135+
DatabaseWindow.new
138136
end
139137
def on_close
140138
close_project if has_project?

src/database.rb

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,26 @@
1616
#
1717
require 'gtk3'
1818

19-
class DatabaseDialog < Gtk::Dialog
20-
def initialize(parent)
21-
super(title: "Database", parent: parent, flags: :modal)
22-
self.add_button(Gtk::Stock::CANCEL, :cancel)
23-
self.add_button(Gtk::Stock::APPLY, :apply)
24-
ok = self.add_button(Gtk::Stock::OK, :ok)
19+
class DatabaseWindow < Gtk::Window
20+
def initialize
21+
super()
22+
self.title = "Database"
23+
24+
buttons = Gtk::ButtonBox.new(:horizontal)
25+
buttons.layout = :end
26+
buttons.spacing = 4
27+
cancel = Gtk::Button.new(stock_id: Gtk::Stock::CANCEL)
28+
apply = Gtk::Button.new(stock_id: Gtk::Stock::APPLY)
29+
ok = Gtk::Button.new(stock_id: Gtk::Stock::OK)
2530
ok.style_context.add_class("suggested-action")
31+
buttons.add(cancel)
32+
buttons.add(apply)
33+
buttons.add(ok)
2634

2735
notebook = Gtk::Notebook.new
2836
notebook.tab_pos = :left
2937
notebook.vexpand = true
38+
notebook.scrollable = true
3039

3140
widget = ActorEditor.new
3241
notebook.append_page(widget, Gtk::Label.new("Actors"))
@@ -43,8 +52,11 @@ def initialize(parent)
4352
not_implemented(notebook, "Tilesets")
4453
not_implemented(notebook, "Common\nEvents")
4554
not_implemented(notebook, "System")
46-
47-
self.child.add(notebook)
55+
56+
vbox = Gtk::Box.new(:vertical)
57+
vbox.add(notebook)
58+
vbox.add(buttons)
59+
self.add(vbox)
4860
self.show_all
4961
end
5062
def not_implemented(notebook, name)

0 commit comments

Comments
 (0)