Skip to content

Commit

Permalink
Tidy up Gtk3 MDI titlebars
Browse files Browse the repository at this point in the history
  • Loading branch information
ejeschke committed May 20, 2024
1 parent 4dd1ed7 commit 09465ac
Show file tree
Hide file tree
Showing 4 changed files with 243 additions and 3 deletions.
27 changes: 24 additions & 3 deletions ginga/gtk3w/GtkHelp.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,16 +284,37 @@ def __init__(self, widget, label):
vbox.set_border_width(4)

hbox = Gtk.HBox()

# set window icon
iconfile = os.path.join(icondir, "ginga.svg")
pixbuf = pixbuf_new_from_file_at_size(iconfile, 32, 32)
image = Gtk.Image.new_from_pixbuf(pixbuf)
hbox.pack_start(image, False, False, 2)

# titlebar label
evbox = Gtk.EventBox()
evbox.add(label)
modify_bg(evbox, "gray90")
self.label = label
self.evbox = evbox
hbox.pack_start(evbox, True, True, 2)

close = Gtk.Button("X")
maxim = Gtk.Button("^")
minim = Gtk.Button("_")
# titlebar buttons
iconfile = os.path.join(icondir, "close.svg")
pixbuf = pixbuf_new_from_file_at_size(iconfile, 24, 24)
image = Gtk.Image.new_from_pixbuf(pixbuf)
close = Gtk.Button()
close.set_image(image)
iconfile = os.path.join(icondir, "maximize.svg")
pixbuf = pixbuf_new_from_file_at_size(iconfile, 24, 24)
image = Gtk.Image.new_from_pixbuf(pixbuf)
maxim = Gtk.Button()
maxim.set_image(image)
iconfile = os.path.join(icondir, "minimize.svg")
pixbuf = pixbuf_new_from_file_at_size(iconfile, 24, 24)
image = Gtk.Image.new_from_pixbuf(pixbuf)
minim = Gtk.Button()
minim.set_image(image)
hbox.pack_start(minim, False, False, 0)
hbox.pack_start(maxim, False, False, 0)
hbox.pack_start(close, False, False, 0)
Expand Down
78 changes: 78 additions & 0 deletions ginga/icons/close.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
76 changes: 76 additions & 0 deletions ginga/icons/maximize.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
65 changes: 65 additions & 0 deletions ginga/icons/minimize.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 09465ac

Please sign in to comment.