Index: uspace/app/clock_widget/clock_widget.c
===================================================================
--- uspace/app/clock_widget/clock_widget.c	(revision 62e3411966e54f06eb6dd3adfd33b1aaae4bfc8a)
+++ uspace/app/clock_widget/clock_widget.c	(revision 62e3411966e54f06eb6dd3adfd33b1aaae4bfc8a)
@@ -0,0 +1,173 @@
+/*
+ * Copyright (c) 2025 Wayne Michael Thornton (WMT) <wmthornton-dev@outlook.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup clock_widget
+ * @{
+ */
+/** @file Clock widget application (in UI)
+ */
+
+#include <gfx/coord.h>
+#include <stdio.h>
+#include <str.h>
+#include <stdlib.h>
+#include <ui/fixed.h>
+#include <ui/label.h>
+#include <ui/pbutton.h>
+#include <ui/entry.h>
+#include <ui/resource.h>
+#include <ui/ui.h>
+#include <ui/window.h>
+#include <device/clock_dev.h>
+#include <loc.h>
+#include <time.h>
+#include "clock_widget.h"
+
+static void wnd_close(ui_window_t *, void *);
+
+static ui_window_cb_t window_cb = {
+	.close = wnd_close
+};
+
+/** Window close button was clicked.
+ *
+ * @param window Window
+ * @param arg Argument (clock_widget)
+ */
+static void wnd_close(ui_window_t *window, void *arg)
+{
+	clock_widget_t *clock_widget = (clock_widget_t *) arg;
+	ui_quit(clock_widget->ui);
+}
+
+/** Run Clock Widget on display server. */
+static errno_t clock_widget(const char *display_spec)
+{
+	ui_t *ui = NULL;
+	ui_wnd_params_t params;
+	ui_window_t *window = NULL;
+	clock_widget_t clock_widget;
+	errno_t rc;
+
+	rc = ui_create(display_spec, &ui);
+	if (rc != EOK) {
+		printf("Error creating UI on display %s.\n", display_spec);
+		return rc;
+	}
+
+	ui_wnd_params_init(&params);
+	params.caption = "Clock Widget";
+	params.placement = ui_wnd_place_center;
+
+	if (ui_is_textmode(ui)) {
+		params.rect.p0.x = 0;
+		params.rect.p0.y = 0;
+		params.rect.p1.x = 45;
+		params.rect.p1.y = 15;
+	} else {
+		params.rect.p0.x = 0;
+		params.rect.p0.y = 0;
+		params.rect.p1.x = 350;
+		params.rect.p1.y = 275;
+	}
+
+	memset((void *) &clock_widget, 0, sizeof(clock_widget));
+	clock_widget.ui = ui;
+
+	rc = ui_window_create(ui, &params, &window);
+	if (rc != EOK) {
+		printf("Error creating window.\n");
+		return rc;
+	}
+
+	ui_window_set_cb(window, &window_cb, (void *) &clock_widget);
+	clock_widget.window = window;
+
+	rc = ui_fixed_create(&clock_widget.fixed);
+	if (rc != EOK) {
+		printf("Error creating fixed layout.\n");
+		return rc;
+	}
+
+	rc = ui_window_paint(window);
+	if (rc != EOK) {
+		printf("Error painting window.\n");
+		return rc;
+	}
+
+	ui_run(ui);
+
+	ui_window_destroy(window);
+	ui_destroy(ui);
+
+	return EOK;
+}
+
+static void print_syntax(void)
+{
+	printf("Syntax: clock_widget [-d <display-spec>]\n");
+}
+
+int main(int argc, char *argv[])
+{
+	const char *display_spec = UI_ANY_DEFAULT;
+	errno_t rc;
+	int i;
+
+	i = 1;
+	while (i < argc && argv[i][0] == '-') {
+		if (str_cmp(argv[i], "-d") == 0) {
+			++i;
+			if (i >= argc) {
+				printf("Argument missing.\n");
+				print_syntax();
+				return 1;
+			}
+
+			display_spec = argv[i++];
+		} else {
+			printf("Invalid option '%s'.\n", argv[i]);
+			print_syntax();
+			return 1;
+		}
+	}
+
+	if (i < argc) {
+		print_syntax();
+		return 1;
+	}
+
+	rc = clock_widget(display_spec);
+	if (rc != EOK)
+		return 1;
+
+	return 0;
+}
+
+/** @}
+ */
Index: uspace/app/clock_widget/clock_widget.h
===================================================================
--- uspace/app/clock_widget/clock_widget.h	(revision 62e3411966e54f06eb6dd3adfd33b1aaae4bfc8a)
+++ uspace/app/clock_widget/clock_widget.h	(revision 62e3411966e54f06eb6dd3adfd33b1aaae4bfc8a)
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2025 Wayne Michael Thornton (WMT) <wmthornton-dev@outlook.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup clock_widget
+ * @{
+ */
+/**
+ * @file Clock widget application (in UI)
+ */
+
+#ifndef CLOCK_WIDGET_H
+#define CLOCK_WIDGET_H
+
+#include <ui/fixed.h>
+#include <ui/label.h>
+#include <ui/pbutton.h>
+#include <ui/ui.h>
+#include <ui/window.h>
+#include <ui/entry.h>
+
+/** Clock widget UI application */
+typedef struct {
+	ui_t *ui;
+	ui_window_t *window;
+	ui_fixed_t *fixed;
+	ui_label_t *date_label;
+	ui_label_t *time_label;
+	ui_entry_t *date_entry;
+	ui_entry_t *time_entry;
+	ui_pbutton_t *ok_button;
+	ui_pbutton_t *set_button;
+	struct tm current_time;
+} clock_widget_t;
+
+#endif
+
+/** @}
+ */
Index: uspace/app/clock_widget/doc/doxygroups.h
===================================================================
--- uspace/app/clock_widget/doc/doxygroups.h	(revision 62e3411966e54f06eb6dd3adfd33b1aaae4bfc8a)
+++ uspace/app/clock_widget/doc/doxygroups.h	(revision 62e3411966e54f06eb6dd3adfd33b1aaae4bfc8a)
@@ -0,0 +1,4 @@
+/** @addtogroup clock_widget clock_widget
+ * @brief Clock widget application (in UI)
+ * @ingroup apps
+ */
Index: uspace/app/clock_widget/meson.build
===================================================================
--- uspace/app/clock_widget/meson.build	(revision 62e3411966e54f06eb6dd3adfd33b1aaae4bfc8a)
+++ uspace/app/clock_widget/meson.build	(revision 62e3411966e54f06eb6dd3adfd33b1aaae4bfc8a)
@@ -0,0 +1,30 @@
+#
+# Copyright (c) 2025 Wayne Michael Thornton (WMT) <wmthornton-dev@outlook.com>
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# - Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# - Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in the
+#   documentation and/or other materials provided with the distribution.
+# - The name of the author may not be used to endorse or promote products
+#   derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+
+deps = [ 'ui' ]
+src = files('clock_widget.c')
Index: uspace/app/meson.build
===================================================================
--- uspace/app/meson.build	(revision 11723261752f4bc89d5d5784fb54c18b0848aaca)
+++ uspace/app/meson.build	(revision 62e3411966e54f06eb6dd3adfd33b1aaae4bfc8a)
@@ -34,4 +34,5 @@
 	'blkdump',
 	'calculator',
+	'clock_widget',
 	'corecfg',
 	'cpptest',
Index: uspace/lib/ui/include/types/ui/clock.h
===================================================================
--- uspace/lib/ui/include/types/ui/clock.h	(revision 62e3411966e54f06eb6dd3adfd33b1aaae4bfc8a)
+++ uspace/lib/ui/include/types/ui/clock.h	(revision 62e3411966e54f06eb6dd3adfd33b1aaae4bfc8a)
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2024
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup libui
+ * @{
+ */
+/**
+ * @file Clock widget types
+ */
+
+#ifndef _UI_TYPES_CLOCK_H
+#define _UI_TYPES_CLOCK_H
+
+#include <gfx/coord.h>
+#include <types/ui/control.h>
+#include <types/ui/resource.h>
+
+struct ui_clock {
+	/** Base control */
+	struct ui_control *control;
+	/** UI resource */
+	ui_resource_t *res;
+	/** Clock rectangle */
+	gfx_rect_t rect;
+	/** Current hour */
+	int hour;
+	/** Current minute */
+	int minute;
+	/** Current second */
+	int second;
+};
+
+typedef struct ui_clock ui_clock_t;
+
+#endif
+
+/** @}
+ */ 
Index: uspace/lib/ui/include/ui/clock.h
===================================================================
--- uspace/lib/ui/include/ui/clock.h	(revision 62e3411966e54f06eb6dd3adfd33b1aaae4bfc8a)
+++ uspace/lib/ui/include/ui/clock.h	(revision 62e3411966e54f06eb6dd3adfd33b1aaae4bfc8a)
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2024
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup libui
+ * @{
+ */
+/**
+ * @file Clock widget
+ */
+
+#ifndef _UI_CLOCK_H
+#define _UI_CLOCK_H
+
+#include <errno.h>
+#include <gfx/coord.h>
+#include <types/ui/clock.h>
+#include <types/ui/control.h>
+#include <types/ui/resource.h>
+
+extern errno_t ui_clock_create(ui_resource_t *, ui_clock_t **);
+extern void ui_clock_destroy(ui_clock_t *);
+extern ui_control_t *ui_clock_ctl(ui_clock_t *);
+extern void ui_clock_set_rect(ui_clock_t *, gfx_rect_t *);
+extern errno_t ui_clock_paint(ui_clock_t *);
+extern void ui_clock_update_time(ui_clock_t *);
+
+#endif
+
+/** @}
+ */ 
Index: uspace/lib/ui/src/clock.c
===================================================================
--- uspace/lib/ui/src/clock.c	(revision 62e3411966e54f06eb6dd3adfd33b1aaae4bfc8a)
+++ uspace/lib/ui/src/clock.c	(revision 62e3411966e54f06eb6dd3adfd33b1aaae4bfc8a)
@@ -0,0 +1,259 @@
+/*
+ * Copyright (c) 2024
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup libui
+ * @{
+ */
+
+#include <errno.h>
+#include <gfx/color.h>
+#include <gfx/context.h>
+#include <gfx/coord.h>
+#include <math.h>
+#include <stdlib.h>
+#include <time.h>
+#include <ui/clock.h>
+#include <ui/paint.h>
+#include <ui/resource.h>
+
+#define CLOCK_HAND_WIDTH 2
+#define CLOCK_HOUR_HAND_LENGTH 0.6
+#define CLOCK_MINUTE_HAND_LENGTH 0.8
+#define CLOCK_SECOND_HAND_LENGTH 0.9
+
+static void ui_clock_ctl_destroy(void *);
+static errno_t ui_clock_ctl_paint(void *);
+
+/** Clock control ops */
+ui_control_ops_t ui_clock_ops = {
+	.destroy = ui_clock_ctl_destroy,
+	.paint = ui_clock_ctl_paint
+};
+
+/** Create clock widget.
+ *
+ * @param resource UI resource
+ * @param rclock Place to store pointer to new clock
+ * @return EOK on success, ENOMEM if out of memory
+ */
+errno_t ui_clock_create(ui_resource_t *resource, ui_clock_t **rclock)
+{
+	ui_clock_t *clock;
+	errno_t rc;
+
+	clock = calloc(1, sizeof(ui_clock_t));
+	if (clock == NULL)
+		return ENOMEM;
+
+	rc = ui_control_new(&ui_clock_ops, (void *) clock, &clock->control);
+	if (rc != EOK) {
+		free(clock);
+		return rc;
+	}
+
+	clock->res = resource;
+	*rclock = clock;
+	return EOK;
+}
+
+/** Destroy clock widget.
+ *
+ * @param clock Clock widget or @c NULL
+ */
+void ui_clock_destroy(ui_clock_t *clock)
+{
+	if (clock == NULL)
+		return;
+
+	ui_control_delete(clock->control);
+	free(clock);
+}
+
+/** Get base control from clock.
+ *
+ * @param clock Clock
+ * @return Control
+ */
+ui_control_t *ui_clock_ctl(ui_clock_t *clock)
+{
+	return clock->control;
+}
+
+/** Set clock rectangle.
+ *
+ * @param clock Clock
+ * @param rect New clock rectangle
+ */
+void ui_clock_set_rect(ui_clock_t *clock, gfx_rect_t *rect)
+{
+	clock->rect = *rect;
+}
+
+/** Draw clock hand.
+ *
+ * @param gc Graphic context
+ * @param center Center point
+ * @param angle Angle in radians
+ * @param length Length as fraction of radius
+ * @param width Width of hand
+ * @param color Color to use
+ * @return EOK on success or an error code
+ */
+static errno_t ui_clock_draw_hand(gfx_context_t *gc, gfx_coord2_t *center,
+    double angle, double length, gfx_coord_t width, gfx_color_t *color)
+{
+	gfx_coord_t radius;
+	gfx_coord2_t end;
+	gfx_rect_t rect;
+	errno_t rc;
+
+	/* Calculate radius as minimum of width/height */
+	radius = min(clock->rect.p1.x - clock->rect.p0.x,
+	    clock->rect.p1.y - clock->rect.p0.y) / 2;
+
+	/* Calculate end point */
+	end.x = center->x + (gfx_coord_t)(radius * length * sin(angle));
+	end.y = center->y - (gfx_coord_t)(radius * length * cos(angle));
+
+	/* Draw hand as a rectangle */
+	rect.p0.x = center->x - width/2;
+	rect.p0.y = center->y - width/2;
+	rect.p1.x = end.x + width/2;
+	rect.p1.y = end.y + width/2;
+
+	rc = gfx_set_color(gc, color);
+	if (rc != EOK)
+		return rc;
+
+	return gfx_fill_rect(gc, &rect);
+}
+
+/** Paint clock.
+ *
+ * @param clock Clock
+ * @return EOK on success or an error code
+ */
+errno_t ui_clock_paint(ui_clock_t *clock)
+{
+	gfx_coord2_t center;
+	gfx_coord_t radius;
+	double hour_angle, min_angle, sec_angle;
+	errno_t rc;
+
+	/* Calculate center and radius */
+	center.x = (clock->rect.p0.x + clock->rect.p1.x) / 2;
+	center.y = (clock->rect.p0.y + clock->rect.p1.y) / 2;
+	radius = min(clock->rect.p1.x - clock->rect.p0.x,
+	    clock->rect.p1.y - clock->rect.p0.y) / 2;
+
+	/* Paint clock face */
+	rc = gfx_set_color(clock->res->gc, clock->res->wnd_face_color);
+	if (rc != EOK)
+		return rc;
+
+	rc = ui_paint_filled_circle(clock->res->gc, &center, radius,
+	    ui_fcircle_entire);
+	if (rc != EOK)
+		return rc;
+
+	/* Paint clock frame */
+	rc = ui_paint_outset_frame(clock->res, &clock->rect, NULL);
+	if (rc != EOK)
+		return rc;
+
+	/* Calculate hand angles */
+	hour_angle = (clock->hour % 12 + clock->minute / 60.0) * M_PI / 6;
+	min_angle = clock->minute * M_PI / 30;
+	sec_angle = clock->second * M_PI / 30;
+
+	/* Draw hour hand */
+	rc = ui_clock_draw_hand(clock->res->gc, &center, hour_angle,
+	    CLOCK_HOUR_HAND_LENGTH, CLOCK_HAND_WIDTH * 2,
+	    clock->res->btn_text_color);
+	if (rc != EOK)
+		return rc;
+
+	/* Draw minute hand */
+	rc = ui_clock_draw_hand(clock->res->gc, &center, min_angle,
+	    CLOCK_MINUTE_HAND_LENGTH, CLOCK_HAND_WIDTH,
+	    clock->res->btn_text_color);
+	if (rc != EOK)
+		return rc;
+
+	/* Draw second hand */
+	rc = ui_clock_draw_hand(clock->res->gc, &center, sec_angle,
+	    CLOCK_SECOND_HAND_LENGTH, CLOCK_HAND_WIDTH,
+	    clock->res->wnd_highlight_color);
+	if (rc != EOK)
+		return rc;
+
+	return gfx_update(clock->res->gc);
+}
+
+/** Update clock time.
+ *
+ * @param clock Clock
+ */
+void ui_clock_update_time(ui_clock_t *clock)
+{
+	time_t now;
+	struct tm *tm;
+
+	time(&now);
+	tm = localtime(&now);
+
+	clock->hour = tm->tm_hour;
+	clock->minute = tm->tm_min;
+	clock->second = tm->tm_sec;
+}
+
+/** Destroy clock control.
+ *
+ * @param arg Argument (ui_clock_t *)
+ */
+static void ui_clock_ctl_destroy(void *arg)
+{
+	ui_clock_t *clock = (ui_clock_t *) arg;
+
+	ui_clock_destroy(clock);
+}
+
+/** Paint clock control.
+ *
+ * @param arg Argument (ui_clock_t *)
+ * @return EOK on success or an error code
+ */
+static errno_t ui_clock_ctl_paint(void *arg)
+{
+	ui_clock_t *clock = (ui_clock_t *) arg;
+
+	return ui_clock_paint(clock);
+}
+
+/** @}
+ */ 
