Skip to content

Commit

Permalink
Menu|All Games: Multiple improvements to menu behavior and appearance
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Sep 23, 2018
1 parent 2625f95 commit 99394c9
Show file tree
Hide file tree
Showing 18 changed files with 707 additions and 381 deletions.
5 changes: 4 additions & 1 deletion doomsday/apps/client/src/render/rend_font.cpp
Expand Up @@ -700,7 +700,10 @@ static void textFragmentDrawer(const char* fragment, int x, int y, int alignFlag
{
// The character itself.
DGL_Color4fv(sat->rgba);
drawChar(c, cx, cy + yoff, font, ALIGN_TOPLEFT, DTF_NO_EFFECTS);
if (sat->rgba[CA] > 0.001f)
{
drawChar(c, cx, cy + yoff, font, ALIGN_TOPLEFT, DTF_NO_EFFECTS);
}
}

if (!noGlitter && glitter > 0)
Expand Down
5 changes: 5 additions & 0 deletions doomsday/apps/plugins/common/include/menu/page.h
Expand Up @@ -99,9 +99,14 @@ class Page
void setOrigin(de::Vector2i const &newOrigin);
de::Vector2i origin() const;

Flags flags() const;
de::Rectanglei viewRegion() const;

void setX(int x);
void setY(int y);

void setLeftColumnWidth(float columnWidthPercentage = 0.6f);

void setPreviousPage(Page *newPreviousPage);
Page *previousPage() const;

Expand Down
Expand Up @@ -108,6 +108,10 @@ class ListWidget : public Widget
*/
bool selectItemByValue(int itemIndex, int flags = MNLIST_SIF_NO_ACTION);

bool reorder(int itemIndex, int indexOffset);

ListWidget &setReorderingEnabled(bool reorderEnabled);

/// @return Index of the currently selected item else -1.
int selection() const;

Expand Down
12 changes: 11 additions & 1 deletion doomsday/apps/plugins/common/include/menu/widgets/widget.h
Expand Up @@ -58,6 +58,9 @@ class Widget
PositionFixed = 0x100, ///< XY position is fixed and predefined; automatic layout does not apply.
LayoutOffset = 0x200, ///< Predefined XY position is applied to the dynamic layout origin.

LeftColumn = 0x400, ///< Widget is laid out to the page's left column.
RightColumn = 0x800, ///< Widget is laid out to the page's right column.

/// @todo We need a new dynamic id mechanism.
Id7 = 0x1000000,
Id6 = 0x2000000,
Expand All @@ -83,7 +86,7 @@ class Widget
Activated, ///< Becomes "active".
Closed, ///< Normally means changed-state to be discarded.
FocusLost, ///< Loses selection "focus".
FocusGained ///< Gains selection "focus".
FocusGained, ///< Gains selection "focus".
};

typedef void (*ActionCallback) (Widget &, Action);
Expand Down Expand Up @@ -162,6 +165,9 @@ class Widget
Widget &setFlags(Flags flagsToChange, de::FlagOp operation = de::SetFlags);
Flags flags() const;

Widget &setLeft() { return setFlags(LeftColumn); }
Widget &setRight() { return setFlags(RightColumn); }

inline bool isActive() const { return flags() & Active; }
inline bool isFocused() const { return flags() & Focused; }
inline bool isHidden() const { return flags() & Hidden; }
Expand Down Expand Up @@ -225,6 +231,10 @@ class Widget
Widget &setUserValue2(QVariant const &newValue);
QVariant const &userValue2() const;

float scrollingFadeout() const;
float scrollingFadeout(int yTop, int yBottom) const;
de::Vector4f selectionFlashColor(const de::Vector4f &noFlashColor) const;

private:
DENG2_PRIVATE(d)
};
Expand Down

0 comments on commit 99394c9

Please sign in to comment.