Skip to content

Documentation

Martí Climent edited this page Jan 26, 2022 · 10 revisions

Table of contents

Documentation:

On this page you'll find all the information relating to ElevenClock's capabilities, features and operation methods.

The Actual Clock

ElevenClock's actual clock is a transparent and frameless window placed where the clock should be. The window is titleless and has the StayOnTop flag enabled. Additionally, it has the Alt-F4 key press event disabled, so the user doesn't accidentally close it. The position is calculated by adding the coordenades of the screen with their size, subtracting the clock's size. If the cock is set to th top and/or to the left, the screen width or height, respectively, is omitted in the calculations. A specific value can be set to the clock's height, as well as offsets can be added to the clock's x and y values.

This window is being constantly raised to prevent the taskbar from displaying over it. If the taskbar has the focus (for example, when the start menu is opened), the clock remains hidden, because a focused top-level window's z-index is higher than the z-index of an unfocused top-level window. This bug can't be fixed, as it is a minor issue and a fix would be difficult to implement, if not impossible.

Time formats

The time format used in the clock is taken from windows registry and converted into a python-compatible % string (see https://docs.python.org/3/library/datetime.html#strftime-and-strptime-format-codes). If the user has seconds enabled, either via Windows Registry or via the Settings Window, and the time format does not contain any s or ss, a %S is added on the string, in a way that it shows just after the minutes.

If the user has the day of the week or the week number features enabled, the corresponding reeference characters are added to the time format string, as well as the date or the time is removed if the user disables them. Those settings appear on the Settings Window, under Date and time preferences.

The clock has a built-in thread that, every 0.1s, converts this format string to the actual machine's date and time using the python function strftime(), from the datetime module

Clock UI

The clock UI, as mentioned before, is based on a transparent window with a transparent background. The color of the text is set to black or white depending on the system's taskbar color scheme (read from the registry). Due to stylistic reasons, the default font, Segoe UI Variable Display changes from it's regular variant to its Semib variant if the mode is set to dark. The background, since version 2.9.2, is set to the clock's most top-left pixel color. This color is got by creating a screenshot of this specific pixel, and then extracting the RGB color. Since the clock's corners are rounded, the pixel in question has (more or less) the color of the taskbar in that region. The dynamic background can be disabled and be set to be transparent or a specific color. The font color, the font family and the font size can be customized as well.

The hover effect is acheved with a semi-transparent widget with a less transparent border and a border radius, being shown and hidden gradually when the mouseIn and mouseOut events are triggered on the window.

Notification counter and focus assistant

If the feature is enabled, the process will check if the focus assistant is enabled, and if it is, it will show the moon displayed in the original clock. If it is not, the process will check if there are unread notifications. If the value is bigger than 0, a notification counter will be displayed. This counter imitates the Windows 11's one, by being round and following system colors.

Those values are taken from the WNF (Windows Notification Facility), with the help of the scripts on WNFUN (https://github.com/ionescu007/wnfun)

The clock's context menu

The Clock's context menu and the system tray menu is a QMenu modified to be transparent, with the fluent graphics effect and border radius applied through the hidden Win32 APIs. The menu lets the user access the most common tools, such as:

  • ElevenClock Settings: The name says it all
  • Reload the clocks: Reload all the clocks. Might be useful
  • An unclickable entry with the clock's version
  • Restart ElevenClock: A button to restart the whole process _ Hide ElevenClock

This page is under construction. You can either create it or wait until it is created. This page is (hopefully) coming soon

ElevenClock

Eleven Clock demo

Customize your Windows 11 taskbar clocks, including those on secondary monitors
Downloads@latest
Release Version Badge
Issues Badge
Closed Issues Badge
Clone this wiki locally