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, areabase: ab,
_widget: widget, _widget: widget,
drawingarea: (*C.GtkDrawingArea)(unsafe.Pointer(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), clickCounter: new(clickCounter),
} }
for _, c := range areaCallbacks { for _, c := range areaCallbacks {

View File

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

View File

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