Skip to content

Commit

Permalink
Show type on using replace tool
Browse files Browse the repository at this point in the history
  • Loading branch information
SpaiR committed Mar 26, 2022
1 parent 997a8a8 commit 70fec11
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/app/action_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,8 @@ func (a *app) DoIgnoreUpdate() {
a.ConfigSaveV(a.config())
}

// DoCheckForUpdate checks for available update.
func (a *app) DoCheckForUpdate() {
log.Println("[app] do check for update")
// DoCheckForUpdates checks for available update.
func (a *app) DoCheckForUpdates() {
log.Println("[app] do check for updates")
a.checkForUpdatesV(true)
}
6 changes: 5 additions & 1 deletion src/app/ui/cpwsarea/wsmap/pmap/panel_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func (p *PaneMap) panelStatusLayoutStatus() (layout w.Layout) {

layout = append(layout, w.Tooltip(w.Text("Tile coordinates of the mouse")))

if tools.IsSelected(tools.TNPick) || (tools.IsSelected(tools.TNDelete) && !tools.Selected().AltBehaviour()) {
if isQuickToolToggled() && !tools.Selected().AltBehaviour() {
if hoveredInstance := p.canvasState.HoveredInstance(); hoveredInstance != nil {
layout = append(layout, w.Layout{
w.SameLine(),
Expand All @@ -44,6 +44,10 @@ func (p *PaneMap) panelStatusLayoutStatus() (layout w.Layout) {
return layout
}

func isQuickToolToggled() bool {
return tools.IsSelected(tools.TNPick) || tools.IsSelected(tools.TNDelete) || tools.IsSelected(tools.TNReplace)
}

func (p *PaneMap) panelStatusLayoutLevels() (layout w.Layout) {
return w.Layout{
w.TextFrame(fmt.Sprintf("Z:%d", p.activeLevel)),
Expand Down
4 changes: 2 additions & 2 deletions src/app/ui/menu/menu.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ type app interface {
DoOpenAbout()
DoOpenLogs()
DoOpenSourceCode()
DoCheckForUpdate()
DoCheckForUpdates()
DoOpenSupport()

// Other
Expand Down Expand Up @@ -254,7 +254,7 @@ func (m *Menu) Process() {
IconEmpty(),
w.MenuItem("Source Code", m.app.DoOpenSourceCode).
Icon(icon.GitHub),
w.MenuItem("Check for Update", m.app.DoCheckForUpdate).
w.MenuItem("Check for Updates", m.app.DoCheckForUpdates).
Icon(icon.SystemUpdate),
w.Separator(),
w.MenuItem("Open Logs Folder", m.app.DoOpenLogs).
Expand Down

0 comments on commit 70fec11

Please sign in to comment.