question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Enhancing imageview implemantation

See original GitHub issue

In ImageView what are the things that still need implementation

class ImageView(Widget):
    """

    Args:
        image (:class:`toga.Image`): The image to display.
        id (str): An identifier for this widget.
        style (:obj:`Style`):
        factory (:obj:`module`): A python module that is capable to return a
            implementation of this class with the same name. (optional & normally not needed)

    Todo:
        * Finish implementation.
    """

Also, in the same file of imageview, are these lines important, as I understood style object will do the work of scaling and alignment.


        # @property
        # def alignment(self):
        #     return self._alignment

        # @alignment.setter
        # def alignment(self, value):
        #     self._alignment = value
        #     self._impl.setAlignment_(NSTextAlignment(self._alignment))

        # @property
        # def scaling(self):
        #     return self._scaling

        # @scaling.setter
        # def scaling(self, value):
        #     self._scaling = value
        #     self._impl.setAlignment_(NSTextAlignment(self._scaling))

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
freakboy3742commented, Oct 11, 2020

To some extent you’ve answered your own question: Basic CSS lets you do <list of things>; Toga currently allows <subset of that list of things>; that means we need to add the things that aren’t currently implemented.

That said:

  • alt-text probably isn’t required. While alt-text is important in a web context for accessibility, I’m not sure the same applies to GUI interfaces.
  • “adjust height and width” is certainly present in Toga at present - but it’s nowhere near as flexible as it is in CSS.
    • Should an image expand to fill available space, or stay a fixed size?
    • If it resizes, should it preserve aspect ratio?
    • If it preserves aspect ratio, which axis controls size?
    • How is the image content aligned (left, right or centered)?
    • If the image is smaller than a given axis, should it repeat in that axis (i.e., image tiling)?

The task at this point is to make an API proposal.

If you wanted to start simple - take something like the “clickable link” feature. That’s a feature that is currently missing. So - propose how we’d add it. As a guide, we have existing examples of “onclick” handlers in Toga, so there won’t be an extensive “design” process - you can probably move right to implementation. But for the other features (like transparency or the height/width adjustments I mentioned), you’ll need to make a proposal for the end-user interface to that feature.

0reactions
freakboy3742commented, Mar 29, 2022

Closing as the proposal doesn’t appear to be heading in a direction that is likely to be accepted.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ImageView - Android Developers
ImageView ; ImageView; ImageView; ImageView ... Views should implement this if they have extra information to associate with the context menu.
Read more >
How to Increase the size of Image View in Android
The easiest way to handle this is to set the ScaleType of the ImageView. There are a number of Scaling Types, but the...
Read more >
Real Time Implementation of Image Enhancement Based on ...
The enhanced V is combined with H and S are converted back into RGB. The experimental results vividly displays the proposed algorithm is...
Read more >
How to Implement Shapeable ImageView in Android?
In Android, ShapeableImageView is used to change the shape of your image to circle, diamond, etc. Also, you can set a corner radius...
Read more >
Let's enhance: use Intel AI to increase image resolution in this ...
We have two pictures of Intel CEO Patrick Gelsinger; one is somewhat blurry—you can't really see his facial features clearly.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found