ChoiceList component - x and y pos for pixmap

  • Hi,


    Is it possible to wish for x and y attributes to adjust for pixmap indent in ChoiceList component? Everything else can be adjustet, but not pixmap. Thanks!


    Code
    <component type="ChoiceList" itemHeight="30" textX="70" textY="0" pixmapX="5" pixmapY="0" textWidth="625" textHeight="30" pixmapWidth="40" pixmapHeight="20" fillerCount="200" />


    Something like this...

    - FoxyRabbit - Peter Pan team -

    2 Mal editiert, zuletzt von FoxyRabbit ()

  • Sorry, missed a word in first post! (indent)


    I just want to request an indent option for pixmap also. And I want a possibillity to adjust pixmap Y if I want to shrink pixmap, wich else will go to top.


    In the screenshot below I have used pixmapX="20" pixmapY="5". Downsized pixmap to 40px x 20px.


    In PP image we have added this option long time ago. The reason for I am requesting this here in this forum is that it should have been added as an option from the start. I just think someone forgot to do it when the components project was running.

  • Nein hab da nix missverstanden man kann das ohne eure Anpassungen im DreamOS machen da ist auch alles mittig beim Icon wenn man die richtigen Werte einsetzt.

    Code
    <component type="ChoiceList" itemHeight="30" textX="70" textY="0" textWidth="625" textHeight="30" pixmapWidth="40" pixmapHeight="30" fillerCount="200" />

    Hier im Beispiel ist dann das Icon 40x20 und mittig und das ohne euren Zusatz den man zwar machen könnte aber normal nicht muss .


    pixmapWidth="40" macht aus dem Icon ein Icon 40x20 (kommt da immer drauf an wie die originalgrößen der Icons sind die man da nutzt)


    pixmapHeight="30" setzt die höhe des Icons anhand der Skalierung und itemHeight,30 ist die itemHeight un d dann wird es mittig gesetzt ,nimmst da einen anderen Wert verschiebt sich das icon in der höhe.

  • In python (see below) ident (x direction) for pixmap is set to 5, and pixmap y position is set to 0. If you downsize pixmap (icon) to less than text size the pixmap will stick to position y0. There is no centering neither in x or y direction. And we dont need that either.


    From standard code: res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHABLEND, 5, 0, pxw, pxh, png)) # x=5 y=0


    Standard code is:



    ...and it could be this, what solves the problem properly:


    You could even go further and auto calculate a textMargin from pixmapWidth to where text starts, but the code above will be good enough for a skin maker to solve every issue.

    - FoxyRabbit - Peter Pan team -

    Einmal editiert, zuletzt von FoxyRabbit ()

  • Indent <> centered. But when the implemented logic always centers the pixmap an indentation wouldn't lead to the expected result.

    Gruss
    Dre


    Boxen (im Einsatz): DM920, DM900, DMOne
    Developer Project Merlin - we are OpenSource

  • @zombi


    If you keep pixmapWidth and pixmapHeight values out of picture ratio values it will center the pixmap wihtin what of those two that are the bigger number. The lesser number will be the pixmap size. Lets say I use 20 for width and 30 height, wich is incorrect by the way. The size of pixmap will be shrinked to 20 width (less) and centered vertically wihtin the height 30, from the point y0. Since 30 is the itemheight this will look OK. but if you set pixmapHeight to 20 it will center pixmap vertically centered from y0 down to y20. You can test this yourself. If you use correct ratio values by the way, your pixmap will stick to x5 and y0 wich is code values.


    Yes, its a form of manipulation trick, but it should not be that way. If I want my pixmap to start at x position 20px, then it should be possible to set that value as an attribute in skin component.


    Anyway, I got it sorted out, just wanted others to have those same options when they work with skins.

    - FoxyRabbit - Peter Pan team -

  • Hab ja gesagt du musst nur die richtigen Werte einsetzen was die höhe angeht und dazu brauch man nunmal keine extra Positionsangabe und ein Trick ist das auch nicht.
    Was per Angabe nicht geht ist die x Position von vorn (weil warum auch) man setzt doch nicht mit Absicht die Icons weiter rein als die 5 px und wenn doch dann kann man eigene Icons mitbringen im Skin die halt den erforderlichen Abstand haben.
    Dream müsste sagen ob sie das da einbauen möchten nur ist das wie gesagt normal nicht nötig für keinen DreamOS skin.

  • Just double your pix x value and keep pix y the same. pixmap then starts to move right. centered within your new x value. So yes, you manipulate it at you wish, but not both ways.


    An indent of only 5 within a selectionPixmap looks really terrible in my opinion. The point here is that we have to leave that question up to the skin makers out there, and not for what have been the "wrong" standard for decades. And why bother with makin attributes for components within skin.xml at all if its not done properly. I can understand that it was missed, but leave it out with overlay is a bit odd. And especially when it is done in other components. Like beginMargin= (ServiceList), and so on.

    - FoxyRabbit - Peter Pan team -

  • It wouldn't harm to allow setting these two values. So, the change would totally make sense. And everyone happy with 5 px will still have it. Zero impact

    Gruss
    Dre


    Boxen (im Einsatz): DM920, DM900, DMOne
    Developer Project Merlin - we are OpenSource

  • Schaden würde das sicherlich keinen aber es ist halt normal nicht nötig da man das mit @Reichi seinen Werten ja schon machen kann ,eventuell schreibt Reichi ja was dazu.
    Für den Abstand vorn kann wie gesagt das mit der Bilddatei gemacht werden ,wobei da die Pos. x von vorn keine schlechte Idee ist um die Icons nicht alle neu erstellen zu müssen für seinen Skin wenn man mehr als 5 px möchte.

  • Ich z.B. hab eine Zeilenhöhe von 35.


    Meine Icons sind rund und haben 25px Durchmesser.


    Ich hab sie halt auf eine Transparente mit 35px gelegt.
    So klappt es ja auch.

  • Sag ja die x Pos. ist ja keine schlechte Idee da man dann die Icons nicht so erstellen muss mit dem Abstand wenn man den möchte,y müsste aber nicht sein.
    Reichi ging es ja auch darum mit so wenig wie möglich viel hinzubekommen ,es sollten halt nicht zig Einträge sein ,falsch ist es halt nicht und auch das Anliegen von @FoxyRabbit ist ok ,wenn also Dream das noch einbauen möchte warum nicht .
    Es sollte halt zeigen das man auch ohne diese Optionen ans Ziel kommt wenn man es so in seinem Skin gern möchte .

  • @root1980
    Wenn deine icons 25 rund sind und die Zeilenhöhe 35 müsste aber das gehen.


    pixmapWidth="25" pixmapHeight="35"
    Anhand der pixmapWidth wird skaliert und die pixmapHeight müsste sie mittig der Zeilenhöhe setzen.

  • Hab das mal schnell getestet und mir die key_.png als runde 25x25 (hier nur mal in gelb ) erstellt und dann das so angegeben.
    Und mit anderen Angaben in der component geht es auch umlaufend mit Rand.

    Code
    <component fillerCount="500" itemHeight="35" pixmapHeight="35" pixmapWidth="25" textHeight="35" textWidth="800" textX="45" textY="0" type="ChoiceList" />
  • pixmapWidth and pixmapHeight should always be set correct in skin.xml This makes the total componentsize the size of the actual pixmap seen. And the values that you see in skin.xml is correct for what you see (you dont make invisible rectangels).


    If you do that you also need the pixmapY option to finetune the Y position for your needs. Else its set to python Y=0 (top).


    And if we want to use small graphic files (x,y), its even more important with the pixmapY attribute.


    I am really bad in german, so bare with me if I dont follow excactly! :face_with_tongue:

    - FoxyRabbit - Peter Pan team -

  • Ach so geht das. Hab ich immer 35 und 35 eingegeben. Dachte, es wird sonst als Ei 25x35 skaliert.
    Dann hab ich ja morgen was zu tun.
    Danke für die Aufklärung.