Re: [SailfishDevel] Image + text element, or a non-rectangular text field possible in silica?

2020-01-06 Thread szopin
Ok, so scrolling the whole panel is the way to go, thanks!

szopin

On Monday, 6 January 2020, David Llewellyn-Jones wrote:
> On 06/01/2020 21:00, szo...@gmail.com wrote:
> > Picture will probably illustrate what I mean easier:
> > https://i.imgur.com/IKyMnAV.png
> 
> The pictures are definitely helpful!
> 
> > This is a self-expanding TextArea as you type, but it will happily go
> > over the screen size and there is no way to get the text at the
> > beginning into focus, I'm probably missing some super obvious way to
> > avoid this? The only way I found to force scroll option was
> > hardcoding its height which is noy pretty.
> I could be misunderstanding completely (especially since you mention in
> your other email about it being in a docked panel, and I'm not sure
> whether that might affect things).
> 
> I think the usual way would be to place the TextArea inside a
> SilicaFlickable with SilicaFlickable.contentHeight set to
> TextArea.contentHeight (or possibly TextArea.implicitHeight or
> TextArea.height). If you include other stuff/padding inside the
> flickable you'll need to take that into account too.
> 
> You can then set the height of the SilicaFlickable to the height
> available on the screen to allow scrolling of everything inside it.
> 
> The notes app does something like this. It's not a great example because
> there's a lot going on, but it might help:
> 
> Line 160 sets the contentHeight:
> 
> /usr/share/jolla-notes/pages/NotePage.qml
> 
> David
> -- 
> Website: http://www.flypig.co.uk
> ___
> SailfishOS.org Devel mailing list
> To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.or

-- 
Sent from my Jolla
___
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org

Re: [SailfishDevel] Image + text element, or a non-rectangular text field possible in silica?

2020-01-06 Thread David Llewellyn-Jones
On 06/01/2020 21:00, szo...@gmail.com wrote:
> Picture will probably illustrate what I mean easier:
> https://i.imgur.com/IKyMnAV.png

The pictures are definitely helpful!

> This is a self-expanding TextArea as you type, but it will happily go
> over the screen size and there is no way to get the text at the
> beginning into focus, I'm probably missing some super obvious way to
> avoid this? The only way I found to force scroll option was
> hardcoding its height which is noy pretty.
I could be misunderstanding completely (especially since you mention in
your other email about it being in a docked panel, and I'm not sure
whether that might affect things).

I think the usual way would be to place the TextArea inside a
SilicaFlickable with SilicaFlickable.contentHeight set to
TextArea.contentHeight (or possibly TextArea.implicitHeight or
TextArea.height). If you include other stuff/padding inside the
flickable you'll need to take that into account too.

You can then set the height of the SilicaFlickable to the height
available on the screen to allow scrolling of everything inside it.

The notes app does something like this. It's not a great example because
there's a lot going on, but it might help:

Line 160 sets the contentHeight:

/usr/share/jolla-notes/pages/NotePage.qml

David
-- 
Website: http://www.flypig.co.uk
___
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org

Re: [SailfishDevel] Image + text element, or a non-rectangular text field possible in silica?

2020-01-06 Thread szopin
Picture will probably illustrate what I mean easier:
https://i.imgur.com/IKyMnAV.png
This is a self-expanding TextArea as you type, but it will happily go over the 
screen size and there is no way to get the text at the beginning into focus, 
I'm probably missing some super obvious way to avoid this? The only way I found 
to force scroll option was hardcoding its height which is noy pretty.

Regards,
szopin 

On Monday, 6 January 2020, David Llewellyn-Jones wrote:
> On 06/01/2020 16:10, szo...@gmail.com wrote:
> > Picture will be helpful: https://i.imgur.com/knA9qZP.png Is there any
> > way to make the text start from left edge after the thumbnail ends?
> > Not sure if there is something that would fill remaining space with
> > text automatically, or if you can maybe hardcode the thumbnail size
> > and force the text field to extend left after x lines?
> 
> One way would be along the lines of your second suggestion, to use the
> lineLaidOut() signal to increase the indent for something like the first
> five lines of your text.
> 
> https://doc.qt.io/qt-5/qml-qtquick-text.html#lineLaidOut-signal
> 
> There's an example of this in the Messages app. When you have a draft
> message shown on the main screen, the first line of the message is
> shifted slightly to the right to accommodate a little pencil icon. The
> code for this is around line 150 of the file
> /usr/share/jolla-messages/pages/groups/GroupDelegate.qml in case the
> example is helpful.
> 
> David
> -- 
> Website: http://www.flypig.co.uk
> ___
> SailfishOS.org Devel mailing list
> To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.or

-- 
Sent from my Jolla
___
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org

Re: [SailfishDevel] Image + text element, or a non-rectangular text field possible in silica?

2020-01-06 Thread szopin
Sorry for another basic qml question, but is there a way to limit a TextArea 
expansion in a docked panel? maximumLineCount doesn't seem to work and the only 
way to get scroll option for longer inputs was hardcoding the height from start 
which is not aesthetically pleasing, but at least allows one to edit the input 
after it would normally end up above screen.

Thanks in advance,
szopin 

On Monday, 6 January 2020, David Llewellyn-Jones wrote:
> On 06/01/2020 16:10, szo...@gmail.com wrote:
> > Picture will be helpful: https://i.imgur.com/knA9qZP.png Is there any
> > way to make the text start from left edge after the thumbnail ends?
> > Not sure if there is something that would fill remaining space with
> > text automatically, or if you can maybe hardcode the thumbnail size
> > and force the text field to extend left after x lines?
> 
> One way would be along the lines of your second suggestion, to use the
> lineLaidOut() signal to increase the indent for something like the first
> five lines of your text.
> 
> https://doc.qt.io/qt-5/qml-qtquick-text.html#lineLaidOut-signal
> 
> There's an example of this in the Messages app. When you have a draft
> message shown on the main screen, the first line of the message is
> shifted slightly to the right to accommodate a little pencil icon. The
> code for this is around line 150 of the file
> /usr/share/jolla-messages/pages/groups/GroupDelegate.qml in case the
> example is helpful.
> 
> David
> -- 
> Website: http://www.flypig.co.uk
> ___
> SailfishOS.org Devel mailing list
> To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.or

-- 
Sent from my Jolla
___
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org

Re: [SailfishDevel] Image + text element, or a non-rectangular text field possible in silica?

2020-01-06 Thread szopin
Awesome, this will do nicely, thank You!

On Monday, 6 January 2020, David Llewellyn-Jones wrote:
> On 06/01/2020 16:10, szo...@gmail.com wrote:
> > Picture will be helpful: https://i.imgur.com/knA9qZP.png Is there any
> > way to make the text start from left edge after the thumbnail ends?
> > Not sure if there is something that would fill remaining space with
> > text automatically, or if you can maybe hardcode the thumbnail size
> > and force the text field to extend left after x lines?
> 
> One way would be along the lines of your second suggestion, to use the
> lineLaidOut() signal to increase the indent for something like the first
> five lines of your text.
> 
> https://doc.qt.io/qt-5/qml-qtquick-text.html#lineLaidOut-signal
> 
> There's an example of this in the Messages app. When you have a draft
> message shown on the main screen, the first line of the message is
> shifted slightly to the right to accommodate a little pencil icon. The
> code for this is around line 150 of the file
> /usr/share/jolla-messages/pages/groups/GroupDelegate.qml in case the
> example is helpful.
> 
> David
> -- 
> Website: http://www.flypig.co.uk
> ___
> SailfishOS.org Devel mailing list
> To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.or

-- 
Sent from my Jolla
___
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org

Re: [SailfishDevel] Image + text element, or a non-rectangular text field possible in silica?

2020-01-06 Thread David Llewellyn-Jones
On 06/01/2020 16:10, szo...@gmail.com wrote:
> Picture will be helpful: https://i.imgur.com/knA9qZP.png Is there any
> way to make the text start from left edge after the thumbnail ends?
> Not sure if there is something that would fill remaining space with
> text automatically, or if you can maybe hardcode the thumbnail size
> and force the text field to extend left after x lines?

One way would be along the lines of your second suggestion, to use the
lineLaidOut() signal to increase the indent for something like the first
five lines of your text.

https://doc.qt.io/qt-5/qml-qtquick-text.html#lineLaidOut-signal

There's an example of this in the Messages app. When you have a draft
message shown on the main screen, the first line of the message is
shifted slightly to the right to accommodate a little pencil icon. The
code for this is around line 150 of the file
/usr/share/jolla-messages/pages/groups/GroupDelegate.qml in case the
example is helpful.

David
-- 
Website: http://www.flypig.co.uk
___
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org