Skip to content

Commit

Permalink
Merge pull request #858 from ailin-nemui/sbar
Browse files Browse the repository at this point in the history
change the statusbar commands so that no accidential status bars are created
  • Loading branch information
ailin-nemui committed Apr 2, 2018
2 parents 0c1db8f + 138eca0 commit 8bf2162
Show file tree
Hide file tree
Showing 4 changed files with 420 additions and 206 deletions.
51 changes: 32 additions & 19 deletions docs/help/in/statusbar.in
Expand Up @@ -5,27 +5,35 @@

%9Parameters:%9

ENABLE: Adds a statusbar to the list of statusbars.
DISABLE: Removes a statusbar from the list. Note that for
built-in statusbars they can be enabled again should the
user wish to add back the default statusbars.
ADD: Adds a statusbar to the list of statusbars.
MODIFY: Modifies the configuration of a statusbar.
RESET: Restores the default statusbar configuration.
TYPE: Sets the type of statusbar, for each split window or only
ADDITEM: Adds an item to the specified statusbar. It can be set to
appear before/after another item and left/right aligned
to a specified position on the screen.
MODIFYITEM: Changes an item position inside a bar.
REMOVEITEM: Removes an item from the specified statusbar.
INFO: List the current details and items of the specified
statusbar.

-disable: Removes a statusbar from the list.
-type: Sets the type of statusbar, for each split window or only
for the current root screen.
PLACEMENT: Sets the placement of the statusbar, either at the top or
-placement: Sets the placement of the statusbar, either at the top or
the bottom of the screen.
POSITION: Sets the position of the statusbar. Represented as a
-position: Sets the position of the statusbar. Represented as a
number, with 0 implying the first position.
VISIBLE: Sets the visibility of the statusbar or item. If set to
-visible: Sets the visibility of the statusbar or item. If set to
always it is visible on all screens, otherwise if set to
inactive or active then it is only visible on inactive
or active screens, respectively.
ADD: Adds an item to the specified statusbar. It can be set to
appear before/after another item and left/right aligned
to a specified position on the screen.
REMOVE: Removes an item from the specified statusbar.
-before: This item is added before the other item.
-after: This item is added after the other item.
-priority: When the statusbar items overflow, the item with the
lowest priority is removed first
-alignment: Display the item on the right side.

Where name refers to the name of the statusbar; if no argument is
Where statusbar refers to the name of the statusbar; if no argument is
given, the entire list of statusbars will be displayed.

%9Description:%9
Expand All @@ -36,12 +44,17 @@
%9Examples:%9

/STATUSBAR
/STATUSBAR window
/STATUSBAR window REMOVE time
/STATUSBAR window ADD time
/STATUSBAR window RESET
/STATUSBAR topic DISABLE
/STATUSBAR topic ENABLE
/STATUSBAR INFO window
/STATUSBAR REMOVEITEM time window
/STATUSBAR ADDITEM time window
/STATUSBAR RESET window
/STATUSBAR MODIFY -disable topic
/STATUSBAR MODIFY -nodisable topic

%9Remarks:%9

Statusbar syntax was changed in Irssi 1.2. The old syntax is still
accepted for backward compatibility, but no longer documented.

%9See also:%9 WINDOW

1 change: 1 addition & 0 deletions src/fe-text/module-formats.c
Expand Up @@ -67,6 +67,7 @@ FORMAT_REC gui_text_formats[] =
{ "statusbar_info_item_footer", "", 0 },
{ "statusbar_info_item_name", "%# : $[35]0 $[9]1 $2", 3, { 0, 1, 0 } },
{ "statusbar_not_found", "Statusbar doesn't exist: $0", 1, { 0 } },
{ "statusbar_not_found", "Statusbar is disabled: $0", 1, { 0 } },
{ "statusbar_item_not_found", "Statusbar item doesn't exist: $0", 1, { 0 } },
{ "statusbar_unknown_command", "Unknown statusbar command: $0", 1, { 0 } },
{ "statusbar_unknown_type", "Statusbar type must be 'window' or 'root'", 1, { 0 } },
Expand Down
17 changes: 9 additions & 8 deletions src/fe-text/module-formats.h
Expand Up @@ -30,23 +30,24 @@ enum {

TXT_FILL_3,

TXT_STATUSBAR_LIST_HEADER,
TXT_STATUSBAR_LIST_HEADER,
TXT_STATUSBAR_LIST_FOOTER,
TXT_STATUSBAR_LIST,
TXT_STATUSBAR_INFO_NAME,
TXT_STATUSBAR_INFO_TYPE,
TXT_STATUSBAR_INFO_PLACEMENT,
TXT_STATUSBAR_INFO_PLACEMENT,
TXT_STATUSBAR_INFO_POSITION,
TXT_STATUSBAR_INFO_VISIBLE,
TXT_STATUSBAR_INFO_ITEM_HEADER,
TXT_STATUSBAR_INFO_ITEM_HEADER,
TXT_STATUSBAR_INFO_ITEM_FOOTER,
TXT_STATUSBAR_INFO_ITEM_NAME,
TXT_STATUSBAR_NOT_FOUND,
TXT_STATUSBAR_ITEM_NOT_FOUND,
TXT_STATUSBAR_INFO_ITEM_NAME,
TXT_STATUSBAR_NOT_FOUND,
TXT_STATUSBAR_NOT_ENABLED,
TXT_STATUSBAR_ITEM_NOT_FOUND,
TXT_STATUSBAR_UNKNOWN_COMMAND,
TXT_STATUSBAR_UNKNOWN_TYPE,
TXT_STATUSBAR_UNKNOWN_TYPE,
TXT_STATUSBAR_UNKNOWN_PLACEMENT,
TXT_STATUSBAR_UNKNOWN_VISIBILITY,
TXT_STATUSBAR_UNKNOWN_VISIBILITY,

TXT_FILL_4,

Expand Down

0 comments on commit 8bf2162

Please sign in to comment.