Welcome to mirror list, hosted at ThFree Co, Russian Federation.

IncreaseZOffsetButton.go « uiWidgets - github.com/Z-Bolt/OctoScreen.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 0c598e7047a7f75c726ac1018920b3afd4deefb5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package uiWidgets

import (
	"github.com/gotk3/gotk3/gtk"
	"github.com/Z-Bolt/OctoScreen/utils"
)

type IncreaseZOffsetButton struct {
	*gtk.Button
	isIncrease					bool
}

func CreateIncreaseZOffsetButton(
	isIncrease					bool,
) *IncreaseZOffsetButton {
	var base *gtk.Button
	if isIncrease {
		base = utils.MustButtonImageStyle("Increase Offset", "z-offset-increase.svg", "", nil)
	} else {
		base = utils.MustButtonImageStyle("Decrease Offset", "z-offset-decrease.svg", "", nil)
	}

	instance := &IncreaseZOffsetButton{
		Button:						base,
		isIncrease:					isIncrease,
	}

	return instance
}

// NOTE: leave the heavy lifting to the parent panel.  If this button is use in multiple places,
// move the logic into here, and also add the dependency controls, and also any internal values
// that are needed.