shotthumb

package
v0.3.28 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: MIT Imports: 11 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package shotthumb is the floating thumbnail a screenshot leaves in a screen corner: it counts down to its own dismissal, pausing while the pointer is over it; a click opens the markup editor, a drag carries the file and its PNG into another app, its delete button discards the capture, and a sideways swipe or Escape dismisses it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DragContent

func DragContent(s Shot) *widget.DragContent

DragContent is what dragging the shot offers: its file as a uri list, then its PNG, streamed from the saved file.

func Size

func Size(w, h int) (int, int)

Size is the logical size the thumbnail shows an image of w x h pixels at: shrunk to fit maxW x maxH, never enlarged, at least one pixel.

Types

type Deps

type Deps struct {
	// Open maps the layer surface.
	Open func(app.LayerConfig) (Window, error)
	// KeySym reads a key code through the seat's keymap.
	KeySym keys.Translator
	// Invoke runs fn on the loop goroutine.
	Invoke func(fn func())
	Clock  clock.Clock
	// Edit opens the markup editor on the shot.
	Edit func(Shot)
	// Delete discards the shot: its file and its clipboard entry.
	Delete func(Shot)
	// Done runs once the thumbnail no longer shows the shot.
	Done func(Shot)
}

Deps are the thumbnail's collaborators.

type Shot

type Shot struct {
	Path  string
	Image render.StillImage
}

Shot is a saved capture: where it is and its pixels.

type Thumbnail

type Thumbnail struct {
	// contains filtered or unexported fields
}

Thumbnail shows one shot at a time; its methods run on the loop goroutine.

func New

func New(d Deps) *Thumbnail

New builds the thumbnail; nothing maps until Show.

func (*Thumbnail) Dismiss

func (t *Thumbnail) Dismiss()

Dismiss takes the thumbnail down, leaving the file as it is.

func (*Thumbnail) Show

func (t *Thumbnail) Show(s Shot, out *app.Output, cfg config.ScreenshotConfig) error

Show replaces whatever the thumbnail shows with s for cfg.ThumbnailMs, in cfg.ThumbnailPosition's corner of out (nil leaves the output to the compositor). A zero duration shows nothing.

func (*Thumbnail) Shown

func (t *Thumbnail) Shown() (Shot, bool)

Shown is the shot on screen, false when there is none.

type Window

type Window interface{ Close() }

Window is the mapped layer surface (app.LayerWindow).

Jump to

Keyboard shortcuts

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