From 8ee7b2b8097ee7d67bb38d0180e81f53c6d05326 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Fri, 8 Aug 2014 20:31:15 -0400 Subject: [PATCH] Removed borders from Areas on the GTK+ backend. --- redo/area_unix.go | 2 +- redo/control_unix.go | 7 ++++--- redo/table_unix.go | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/redo/area_unix.go b/redo/area_unix.go index b6c70cb..8b96ff0 100644 --- a/redo/area_unix.go +++ b/redo/area_unix.go @@ -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 { diff --git a/redo/control_unix.go b/redo/control_unix.go index 5531b3c..fad5c35 100644 --- a/redo/control_unix.go +++ b/redo/control_unix.go @@ -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 - C.gtk_scrolled_window_set_shadow_type(s.scrollwindow, C.GTK_SHADOW_IN) + 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 { diff --git a/redo/table_unix.go b/redo/table_unix.go index f6ac068..611beae 100644 --- a/redo/table_unix.go +++ b/redo/table_unix.go @@ -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)),