Skip to content

Commit

Permalink
Merge pull request #305 from johnbenweber/fix-299
Browse files Browse the repository at this point in the history
Fix for About popup
  • Loading branch information
BarbourSmith authored May 31, 2017
2 parents c2af100 + 09e8d63 commit b78cd1c
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 4 deletions.
18 changes: 18 additions & 0 deletions UIElements/pageableTextPopup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from kivy.uix.floatlayout import FloatLayout
from kivy.properties import ObjectProperty
from kivy.properties import StringProperty
from UIElements.scrollableLabel import ScrollableLabel


class PageableTextPopup(FloatLayout):
'''
A Pop-up Dialog To Display Text
If the text does not all fit on the display, the user can scroll it
'''
cancel = ObjectProperty(None)
next = ObjectProperty(None)
prev = ObjectProperty(None)
text = StringProperty("")
2 changes: 0 additions & 2 deletions UIElements/scrollableTextPopup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,4 @@ class ScrollableTextPopup(FloatLayout):
'''
cancel = ObjectProperty(None)
next = ObjectProperty(None)
prev = ObjectProperty(None)
text = StringProperty("")
4 changes: 2 additions & 2 deletions UIElements/viewMenu.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from kivy.uix.gridlayout import GridLayout
from UIElements.loadDialog import LoadDialog
from UIElements.scrollableTextPopup import ScrollableTextPopup
from UIElements.pageableTextPopup import PageableTextPopup
from kivy.uix.popup import Popup
import re
from DataStructures.makesmithInitFuncs import MakesmithInitFuncs
Expand Down Expand Up @@ -110,7 +110,7 @@ def show_gcode(self):
popupText = popupText + "...\n...\n...\n"
break

content = ScrollableTextPopup(cancel = self.dismiss_popup,
content = PageableTextPopup(cancel = self.dismiss_popup,
prev = self.show_gcode_prev,
next = self.show_gcode_next,
text = popupText)
Expand Down
16 changes: 16 additions & 0 deletions groundcontrol.kv
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,22 @@
on_release: root.continueOn()

<ScrollableTextPopup>:
BoxLayout:
size: root.size
pos: root.pos
orientation: "vertical"

ScrollableLabel:
text: root.text

BoxLayout:
size_hint_y: None
height: dp(30)
Button:
text: "Close"
on_release: root.cancel()

<PageableTextPopup>:
BoxLayout:
size: root.size
pos: root.pos
Expand Down

0 comments on commit b78cd1c

Please sign in to comment.