Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Para align misbehaviour #402

Closed
arjunmenon opened this issue Mar 11, 2018 · 3 comments
Closed

Para align misbehaviour #402

arjunmenon opened this issue Mar 11, 2018 · 3 comments
Assignees

Comments

@arjunmenon
Copy link

arjunmenon commented Mar 11, 2018

Hey
The para align property does not align elements, left and right, as expected
screenshot from 2018-03-11 21 30 01
Shouldn't the right align, push the para to the window edge?
Alternatively, using right: 0 shoves it way past the window edge
screenshot from 2018-03-11 21 35 39

hash_items = {:apple => "fruit", :ball => "toy", "cat" => "animal", :dog => "animal", :egg => "food"}

Shoes.app(:title => "Shoes APp", :width => 350, :height => 500, :resizable => false) do	
	stack(margin: 10, width: "100%") do
		border black, strokewidth: 5
		hash_items.each do |k,v|
			flow do
				border red, strokewidth: 5
				para k, :align => "left"
				para v, :align => "right" # , :right => 0
			end
		end		
	end
end

EDIT - on elementary 0.4.1, ubuntu 16.04

@ccoupe ccoupe self-assigned this Apr 2, 2018
@ccoupe
Copy link

ccoupe commented Apr 2, 2018

There is a related? bug for Shoes 4 #1559 which looks like this in Shoes3 - this script,

Shoes.app height: 200, width: 200 do
  stack do
    title 'Center', align: 'center'
    para 'Default'
    para 'Default'
    para 'right-aligned 1', align: 'right'
    para 'right-aligned 2', align: 'right'
    para 'left-aligned 1', align: 'left'
    para 'left-aligned 2', align: 'left'
    para 'centered 1', align: 'center'
    para 'centered 2', align: 'center'
  end
end

bug402b

@ccoupe
Copy link

ccoupe commented Apr 2, 2018

The second example shows that right-align works for text in the para. You can also comment the #para k, align: "left" and right is correct. Shoes has a habit of merging para in some situations and I suspect that is what is happening here. This script almost gets it - flow is tricky when it overflows.

hash_items = {:apple => "fruit", :ball => "toy", "cat" => "animal", :dog => "animal", :egg => "food"}

Shoes.app(:title => "Shoes APp", :width => 350, :height => 500 ) do
    stack(margin: 10, width: "100%") do
        border black, strokewidth: 5
        hash_items.each do |k,v|
            flow do
                border red, strokewidth: 5
                stack width: 200 do
                  para k, align: "left"
                end
                stack width: 100 do
                  para v, align: "right"
               end
            end
        end
    end
end

@arjunmenon
Copy link
Author

This will do. Thanks,

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

No branches or pull requests

2 participants