Skip to content

Commit

Permalink
Merge pull request #53 from BallAerospace/make-about-dialog-scroll
Browse files Browse the repository at this point in the history
closes #49 Make About Dialog Scroll
  • Loading branch information
ryanmelt committed Feb 10, 2015
2 parents 286a9fc + f1c4bc2 commit 651f514
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions lib/cosmos/gui/dialogs/about_dialog.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,9 @@ def initialize (parent, about_string)
configurable_about_text = File.read(filename)
configurable_about_text.gsub!("\r", '') unless Kernel.is_windows?
if Kernel.is_windows?
configurable_about_text += "\n" + ABOUT_COSMOS + "\n" + "Main Application x:#{parent.x} y:#{parent.y} width:#{parent.frameGeometry.width + 16} height:#{parent.frameGeometry.height + 38}"
configurable_about_text += "\n" + "Main Application x:#{parent.x} y:#{parent.y} width:#{parent.frameGeometry.width + 16} height:#{parent.frameGeometry.height + 38}\n\n" + ABOUT_COSMOS
else
configurable_about_text += "\n" + ABOUT_COSMOS + "\n" + "Main Application x:#{parent.x} y:#{parent.y} width:#{parent.frameGeometry.width} height:#{parent.frameGeometry.height}"
end
configurable_about_text += "\n" + "Main Application x:#{parent.x} y:#{parent.y} width:#{parent.frameGeometry.width} height:#{parent.frameGeometry.height}\n\n" + ABOUT_COSMOS end

# Set the application about text
about = Qt::Label.new(about_string + "\n\n" + configurable_about_text)
Expand All @@ -89,8 +88,22 @@ def initialize (parent, about_string)
end

self.layout = Qt::VBoxLayout.new do
addLayout(icon_layout)
addWidget(about)
scroll_area = Qt::ScrollArea.new
scroll_area.setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff)
addWidget(scroll_area)
scroll_widget = Qt::Widget.new
scroll_area.setWidget(scroll_widget)
interior_layout = Qt::VBoxLayout.new
interior_layout.addLayout(icon_layout)
interior_layout.addWidget(about)
scroll_widget.setLayout(interior_layout)
if scroll_widget.minimumSizeHint.height < 800
scroll_area.setMinimumHeight(scroll_widget.minimumSizeHint.height + 80)
scroll_area.setMinimumWidth(scroll_widget.minimumSizeHint.width)
else
scroll_area.setMinimumWidth(scroll_widget.minimumSizeHint.width + 20)
end
scroll_widget.adjustSize
addLayout(button_layout)
end

Expand Down

0 comments on commit 651f514

Please sign in to comment.