Beispiel #1
0
func (account *account) setCurrentNotification(ib gtki.InfoBar, notificationArea gtki.Box) {
	account.Lock()
	defer account.Unlock()

	account.removeCurrentNotification()
	account.currentNotification = ib
	notificationArea.Add(ib)
	ib.ShowAll()
}
Beispiel #2
0
func newUnifiedLayout(ui *gtkUI, left, parent gtki.Box) *unifiedLayout {
	ul := &unifiedLayout{
		ui:           ui,
		cl:           &conversationList{},
		leftPane:     left,
		itemMap:      make(map[int]*conversationStackItem),
		isFullscreen: false,
	}
	ul.cl.layout = ul

	builder := newBuilder("UnifiedLayout")
	builder.getItems(
		"treeview", &ul.cl.view,
		"liststore", &ul.cl.model,
		"headerbar", &ul.headerBar,

		"right", &ul.rightPane,
		"notebook", &ul.notebook,
		"header_label", &ul.header,
		"header_box", &ul.headerBox,
		"close_button", &ul.close,
	)
	builder.ConnectSignals(map[string]interface{}{
		"on_activate":    ul.cl.onActivate,
		"on_clicked":     ul.onCloseClicked,
		"on_switch_page": ul.onSwitchPage,
	})

	connectShortcut("<Primary>Page_Down", ul.ui.window, ul.nextTab)
	connectShortcut("<Primary>Page_Up", ul.ui.window, ul.previousTab)
	connectShortcut("F11", ul.ui.window, ul.toggleFullscreen)

	parent.PackStart(ul.rightPane, false, true, 0)
	parent.SetChildPacking(ul.leftPane, false, true, 0, gtki.PACK_START)

	ul.notebook.SetSizeRequest(500, -1)
	ul.rightPane.Hide()

	ul.ui.window.SetTitlebar(ul.headerBar)

	left.SetHAlign(gtki.ALIGN_FILL)
	left.SetHExpand(true)
	return ul
}