Removed borders from Areas on the GTK+ backend.

This commit is contained in:
Pietro Gagliardi 2014-08-08 20:31:15 -04:00
parent ff6c3a7cbe
commit 8ee7b2b809
3 changed files with 6 additions and 5 deletions

View File

@ -50,7 +50,7 @@ func newArea(ab *areabase) Area {
areabase: ab,
_widget: widget,
drawingarea: (*C.GtkDrawingArea)(unsafe.Pointer(widget)),
scroller: newScroller(widget, false), // not natively scrollable,
scroller: newScroller(widget, false, false), // not natively scrollable, no border
clickCounter: new(clickCounter),
}
for _, c := range areaCallbacks {

View File

@ -71,7 +71,7 @@ type scroller struct {
scrollwindow *C.GtkScrolledWindow
}
func newScroller(widget *C.GtkWidget, native bool) *scroller {
func newScroller(widget *C.GtkWidget, native bool, bordered bool) *scroller {
scrollwidget := C.gtk_scrolled_window_new(nil, nil)
s := &scroller{
scrollwidget: scrollwidget,
@ -79,8 +79,9 @@ func newScroller(widget *C.GtkWidget, native bool) *scroller {
scrollwindow: (*C.GtkScrolledWindow)(unsafe.Pointer(scrollwidget)),
}
// give the scrolled window a border (thanks to jlindgren in irc.gimp.net/#gtk+)
// TODO not on Areas
if bordered {
C.gtk_scrolled_window_set_shadow_type(s.scrollwindow, C.GTK_SHADOW_IN)
}
if native {
C.gtk_container_add(s.scrollcontainer, widget)
} else {

View File

@ -31,7 +31,7 @@ type table struct {
func finishNewTable(b *tablebase, ty reflect.Type) Table {
widget := C.gtk_tree_view_new()
t := &table{
scroller: newScroller(widget, true),
scroller: newScroller(widget, true, true), // natively scrollable; has a border
tablebase: b,
_widget: widget,
treeview: (*C.GtkTreeView)(unsafe.Pointer(widget)),