Page MenuHomePhabricator

enum Efl.Ui.Popup_Align
Closed, ResolvedPublic


enum @beta Efl.Ui.Popup_Align {
    [[Popup alignment type]]
    none = 0, [[Popup not aligned]]
    center,   [[Popup aligned to center]]
    left,     [[Popup aligned to left]]
    right,    [[Popup aligned to right]]
    top,      [[Popup aligned to top]]
    bottom    [[Popup aligned to bottom]]

Action Items

  • Make const values out of this, the const values should reflect size_hint_align values.

Related Objects

segfaultxavi triaged this task as TODO priority.
woohyun added a subscriber: herb.Jun 18 2019, 4:07 AM

@herb @Jaehyun_Cho

Let's take a look at this together.
I'm only wondering that top-left, top-right, bottom-left and bottom-right are not needed.

Couldn't we have this as normal align ? with 2 float numbers ?
(0.0 beeing left or top, 1.0 beeing right or bottom)

Yeah, that's a good point! Let's use two floats and get rid of another type :)

herb added a comment.EditedJun 26 2019, 2:12 AM

The enum values support the alignment setting for the very high frequent alignment.
I think this is the important factor from the user perspective.
Also there need to add left_top, right_top, left_bottom, right_bottom enum values.

but I agree that using align-hint for more precise alignment of popup.
how about using two APIs for the alignment of popup?
I think both of the below are good for me.

  • efl_ui_popup_align_set(popup, EFL_UI_POPUP_ALIGN_CENTER);
  • efl_gfx_hint_align_set(popup, 0.5, 0.5);

Using two APIs to controll the same thing looks a bit dangerous to me. We can add const values for indicating the right aligns for the predefined positions. But i would prefer to *not* add 2 APIs for the same thing.

(This also opens up a whole new can of worms, what is the getter returning in the popup API when efl_gfx_hint_align_set was used to something that is not represented in the enum?)

Besides what @bu5hm4n just said:

I see ALIGN_CENTER is easier to understand than 0.5, that's for sure, however, I do not like having a dedicated enum for this, that only works for Popup_Align. What about all the other things that can be aligned? Why don't they have their own enums? It will be confusing for the user.
We can always add constants like EFL_UI_ALIGN_LEFT = 0.0, etc., to simplify things for the user.

zmike added a comment.Jun 26 2019, 6:44 AM

I'm still confused why this exists if we have align hints?

herb added a comment.Jun 26 2019, 6:37 PM

I agree to bu5hm4n's opinion and I think segfaultxavi's idea can be good alternatives.
It looks good for me :)

bu5hm4n updated the task description. (Show Details)Jun 26 2019, 11:36 PM

@herb cool! :) I have added the action items to the popup.


Could you do the action item on the description ?
Plus, if you are thinking of another action item - please share it here.

herb added a comment.Aug 29 2019, 1:04 AM

After zmike's refactoring the popup, the enum will be removed

zmike moved this task from Backlog to Trivial on the efl: api board.Aug 30 2019, 11:07 AM

Alright so this actually isn't getting removed.

The issue here is that align hints cannot work for this widget. Popup needs to have a 'priority' system for its alignment, and this priority system cannot work if we use align hints since there is no way to set a "priority list" of align hints.

As a result, we'll need to keep this around along with the priority thing in order to provide the required functionality. It's not ideal, but that's the functionality that app developers are needing.

This doesn't really need changes, so I'm marking it stable.

zmike moved this task from Trivial to Stabilized on the efl: api board.Aug 30 2019, 11:26 AM