|
|
@@ -437,6 +437,8 @@ static void draw_bar(void)
|
|
|
WM_BTN_CHAT_H, "Chat");
|
|
|
bar_button(WM_BTN_DISKS_X, WM_BTN_DISKS_Y, WM_BTN_DISKS_W,
|
|
|
WM_BTN_DISKS_H, "Disks");
|
|
|
+ bar_button(WM_BTN_PROCESS_X, WM_BTN_PROCESS_Y, WM_BTN_PROCESS_W,
|
|
|
+ WM_BTN_PROCESS_H, "Tasks");
|
|
|
if (bar_msg_until &&
|
|
|
(int)(u_ticks_ms() - bar_msg_until) < 0)
|
|
|
usurf_text(&screen, (int)(WM_BTN_END_X + 8),
|
|
|
@@ -540,21 +542,34 @@ static void draw_bar(void)
|
|
|
}
|
|
|
}
|
|
|
if (u_rtc_datetime(dt, sizeof(dt)) == 0) {
|
|
|
+ char cdt[12];
|
|
|
+ const char *txt = dt;
|
|
|
int tw = (int)usurf_text_width(&screen, dt);
|
|
|
int tx = right - tw;
|
|
|
-
|
|
|
- n = 0;
|
|
|
- while (dt[n] && n < sizeof(dt) - 1)
|
|
|
- n++;
|
|
|
- bar_clock_x = tx;
|
|
|
- bar_clock_w = (unsigned int)tw;
|
|
|
- if (bar_clock_hot)
|
|
|
- usurf_fill(&screen, tx - 5, 2,
|
|
|
- (unsigned int)tw + 10,
|
|
|
- WM_BAR_H - 7, 0x3A3A55u);
|
|
|
- usurf_text(&screen, tx, 5, dt, COL_BANNER, 0, 0,
|
|
|
- fbw, WM_BAR_H);
|
|
|
- clock_chars = (unsigned int)tw;
|
|
|
+ unsigned int i;
|
|
|
+
|
|
|
+ if (tx < min_x) {
|
|
|
+ /* Compact form "MM-DD HH:MM" from
|
|
|
+ * "YYYY-MM-DD HH:MM:SS" when the launcher row is
|
|
|
+ * too wide for the full date. */
|
|
|
+ for (i = 0; i < 11 && dt[5 + i]; i++)
|
|
|
+ cdt[i] = dt[5 + i];
|
|
|
+ cdt[i] = '\0';
|
|
|
+ txt = cdt;
|
|
|
+ tw = (int)usurf_text_width(&screen, cdt);
|
|
|
+ tx = right - tw;
|
|
|
+ }
|
|
|
+ if (tx >= min_x) {
|
|
|
+ bar_clock_x = tx;
|
|
|
+ bar_clock_w = (unsigned int)tw;
|
|
|
+ if (bar_clock_hot)
|
|
|
+ usurf_fill(&screen, tx - 5, 2,
|
|
|
+ (unsigned int)tw + 10,
|
|
|
+ WM_BAR_H - 7, 0x3A3A55u);
|
|
|
+ usurf_text(&screen, tx, 5, txt, COL_BANNER, 0, 0,
|
|
|
+ fbw, WM_BAR_H);
|
|
|
+ clock_chars = (unsigned int)tw;
|
|
|
+ }
|
|
|
}
|
|
|
if (clock_chars)
|
|
|
right -= (int)clock_chars + 8;
|
|
|
@@ -1762,12 +1777,12 @@ static int bar_launcher_hit(unsigned int mx, unsigned int my)
|
|
|
static const int x0[] = {
|
|
|
WM_BTN_X, WM_BTN_CLOCK_X, WM_BTN_COLORS_X, WM_BTN_FILES_X,
|
|
|
WM_BTN_MINES_X, WM_BTN_WEB_X, WM_BTN_CARDS_X, WM_BTN_GALLERY_X,
|
|
|
- WM_BTN_CHAT_X, WM_BTN_DISKS_X
|
|
|
+ WM_BTN_CHAT_X, WM_BTN_DISKS_X, WM_BTN_PROCESS_X
|
|
|
};
|
|
|
static const int w[] = {
|
|
|
WM_BTN_W, WM_BTN_CLOCK_W, WM_BTN_COLORS_W, WM_BTN_FILES_W,
|
|
|
WM_BTN_MINES_W, WM_BTN_WEB_W, WM_BTN_CARDS_W, WM_BTN_GALLERY_W,
|
|
|
- WM_BTN_CHAT_W, WM_BTN_DISKS_W
|
|
|
+ WM_BTN_CHAT_W, WM_BTN_DISKS_W, WM_BTN_PROCESS_W
|
|
|
};
|
|
|
unsigned int i;
|
|
|
|
|
|
@@ -1954,6 +1969,10 @@ static void handle_mouse(struct wm_status *st)
|
|
|
mx < WM_BTN_DISKS_X + WM_BTN_DISKS_W &&
|
|
|
my < WM_BTN_DISKS_Y + WM_BTN_DISKS_H) {
|
|
|
spawn_app_checked("/ramfs/bin/disks");
|
|
|
+ } else if (mx >= WM_BTN_PROCESS_X && my >= WM_BTN_PROCESS_Y &&
|
|
|
+ mx < WM_BTN_PROCESS_X + WM_BTN_PROCESS_W &&
|
|
|
+ my < WM_BTN_PROCESS_Y + WM_BTN_PROCESS_H) {
|
|
|
+ spawn_app_checked("/ramfs/bin/process");
|
|
|
} else {
|
|
|
int edges = 0;
|
|
|
int idx = resize_hit((int)mx, (int)my, &edges);
|