Skip to content

Questions about viewport #85

Description

@mistakenelf
  • Maybe im not going about this the correct way but im working on a file manager just for fun here https://github.com/knipferrc/fm. Trying to figure out how to implement the viewport and its somewhat working but I have a couple issues.
  1. ) Whenever I check if m.ready inside the view, it just sits in a loading state infinitely. Maybe im not initializing something correctly?
case tea.WindowSizeMsg:
		if !m.ready {
			m.screenwidth = msg.Width
			m.screenheight = msg.Height
			m.viewport = viewport.Model{
				Width:  msg.Width,
				Height: msg.Height - 1,
			}
			m.viewport.YPosition = 0
			m.ready = true
		} else {
			m.screenwidth = msg.Width
			m.screenheight = msg.Height
			m.viewport.Width = msg.Width
			m.viewport.Height = msg.Height - 1
		}
  1. ) Whenever I call viewport.LineUp or LineDown it seems to take no effect on the viewport? Attempting to get it so that you can scroll through your directly tree when the height goes outside the terminal

Any help is much appreciated

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions