Skip to content

Instantly share code, notes, and snippets.

@Helco
Last active February 7, 2018 18:04
Show Gist options
  • Save Helco/b7f6868503c3db2864fc42d025cc352a to your computer and use it in GitHub Desktop.
Save Helco/b7f6868503c3db2864fc42d025cc352a to your computer and use it in GitHub Desktop.
Non-original menu_layer extensions
// menu_layer_set_column_number would be used to implement the ActionMenuLevelDisplayModeThin functionality
// menu_layer_set_reload_behaviour tp implement the action menu on chalk (as the highlighted cell takes up more space than non-highlighted)
// my biggest doubt is MenuLayerReloadBehaviourOnRender as I don't see a use-case for it, I included it for completion reasons
//! Sets the number of columns for the \ref MenuLayer. A cell then has a width of
//! `frame.size.w / num_columns`. The height of a particular row is determined by the
//! maximum height of the cells (and the separators). If there are less than
//! `num_columns` in a row the additional space is not touched.
//! @param menu_layer Pointer to the \ref MenuLayer for which to set the column number.
//! @param num_columns The number of columns to set for the \ref MenuLayer.
void menu_layer_set_column_number(MenuLayer *menu_layer, uint16_t num_columns);
//! Value to describe the reload behaviour for \ref MenuLayer.
//! @see \ref menu_layer_set_reload_behaviour
typedef enum {
MenuLayerReloadBehaviourManual = 0, //!< The data is reloaded only on manual API calls (e.g. \ref menu_layer_set_callbacks).
MenuLayerReloadBehaviourOnSelection, //!< The data is reloaded on every selection change (and manual API calls).
MenuLayerReloadBehaviourOnRender //!< The data is reloaded before every rendering.
} MenuLayerReloadBehaviour;
//! Sets the reload behaviour for the \ref MenuLayer. This mode decides when the menu
//! data is reloaded via the \ref MenuLayerCallbacks.
//! @param menu_layer Pointer to the \ref MenuLayer for which to set the reload behaviour.
//! @param behaviour The new reload behaviour to set for the \ref MenuLayer.
//! @see MenuLayerReloadBehaviour
void menu_layer_set_reload_behaviour(MenuLayer *menu_layer, MenuLayerReloadBehaviour behaviour);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment