forked from awesomeWM/awesome
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
We now have the beginnings of a flexible widget structure for the statusbar. For now, there is no behavioural change, and the interface is a bit crude, but watch this space!
- Loading branch information
Showing
10 changed files
with
308 additions
and
152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
|
||
#include "widget.h" | ||
|
||
|
||
void | ||
calculate_alignments(Widget *widget) | ||
{ | ||
while (widget){ | ||
printf("%s\n", widget->name); | ||
if (widget->alignment == AlignFlex){ | ||
widget = widget->next; | ||
break; | ||
} | ||
widget->alignment = AlignLeft; | ||
widget = widget->next; | ||
} | ||
if (widget){ | ||
while (widget){ | ||
widget->alignment = AlignRight; | ||
widget = widget->next; | ||
} | ||
} | ||
} | ||
|
||
int | ||
calculate_offset(int barwidth, int widgetwidth, int offset, int alignment) | ||
{ | ||
if (alignment == AlignLeft || alignment == AlignFlex) | ||
return offset; | ||
else | ||
return barwidth - offset - widgetwidth; | ||
} | ||
|
||
// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#ifndef AWESOME_WIDGET_H | ||
#define AWESOME_WIDGET_H | ||
|
||
#include "config.h" | ||
#include "draw.h" | ||
|
||
enum { AlignLeft, AlignRight, AlignFlex }; | ||
|
||
int calculate_offset(int, int, int, int); | ||
void calculate_alignments(Widget *widget); | ||
|
||
Widget *layoutinfo_new(Statusbar*); | ||
Widget *taglist_new(Statusbar*); | ||
Widget *textbox_new(Statusbar*); | ||
Widget *focustitle_new(Statusbar*); | ||
|
||
#endif | ||
|
||
// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 |
Oops, something went wrong.