space

package
v0.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 4, 2022 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller interface {
	// OpenRoom opens the given room. The function should call back
	// List.SetSelectedRoom.
	OpenRoom(matrix.RoomID)
	// ForwardTypingTo returns the widget that typing events that are uncaught
	// in the List should be forwarded to.
	ForwardTypingTo() gtk.Widgetter
}

Controller describes the controller requirement.

type List

type List struct {
	*gtk.Box

	SearchBar *gtk.SearchBar
	// contains filtered or unexported fields
}

List describes a room list showing rooms within a space (or no space, i.e. the global space).

func New

func New(ctx context.Context, ctrl Controller) *List

New creates a new room list widget.

func (*List) AddRoom

func (l *List) AddRoom(roomID matrix.RoomID)

AddRoom adds the room into the given list.

func (*List) InvalidateFilter

func (l *List) InvalidateFilter()

InvalidateFilter invalidates all sections' filters.

func (*List) InvalidateSections

func (l *List) InvalidateSections()

InvalidateSections throws away the session box and recreates a new one from the internal list. It will sort the internal sections list.

func (*List) IsSearching

func (l *List) IsSearching() bool

IsSearching returns true if the user is searching for rooms.

func (*List) MoveRoomToSection

func (l *List) MoveRoomToSection(src matrix.RoomID, dst *section.Section) bool

MoveRoomToSection moves the room w/ the given ID to the given section. False is returend if the return doesn't make sense.

func (*List) MoveRoomToTag

func (l *List) MoveRoomToTag(src matrix.RoomID, tag matrix.TagName) bool

MoveRoomToTag moves the room to the new tag.

func (*List) OpenRoom

func (l *List) OpenRoom(id matrix.RoomID)

OpenRoom opens the given room.

func (*List) OpenRoomInTab

func (l *List) OpenRoomInTab(id matrix.RoomID)

OpenRoomInTab opens the given room in a new tab.

func (*List) Room

func (l *List) Room(id matrix.RoomID) *room.Room

Room gets the room with the given ID, or nil if the room is unknown.

func (*List) RoomIsVisible

func (l *List) RoomIsVisible(roomID matrix.RoomID) bool

RoomIsVisible returns true if the room with the given ID should be visible.

func (*List) Search

func (l *List) Search(str string)

Search searches for a room of the given name.

func (*List) SetSelectedRoom

func (l *List) SetSelectedRoom(id matrix.RoomID)

SetSelectedRoom sets the given room ID as the selected room row. It does not activate the room.

func (*List) SetSpaceID

func (l *List) SetSpaceID(spaceID matrix.RoomID)

SetSpaceID sets the space room ID of the list. This causes the list to filter out all rooms, only leaving behind rooms that belong to the given space. Sections that don't have any rooms after filtering will be hidden.

func (*List) SpaceID

func (l *List) SpaceID() matrix.RoomID

SpaceID returns the ID of the currently displayed space. If it's empty, then the list will show all rooms, i.e. no filtering is done.

func (*List) VAdjustment

func (l *List) VAdjustment() *gtk.Adjustment

VAdjustment returns the list's ScrolledWindow's vertical adjustment for scrolling.

type RoomTabOpener

type RoomTabOpener interface {
	OpenRoomInTab(matrix.RoomID)
}

RoomTabOpener can optionally be implemented by Application.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL