Widget Analog Clock Free Download

0 views
Skip to first unread message

Andera Swearengin

unread,
Jan 10, 2024, 5:52:49 AM1/10/24
to perchoolbcazug

I am a Linux user of "intermediate" experience. I use Arch (i686) with XFCE on a moderately old Acer Aspire 2920Z laptop -- and I was trying to get an analog clock on the screen without "cairo dock" (which I hate -- all I want from it is a clock, anyway).

Puppy Linux uses "xonclock" which is nice AND in the AUR -- but it no longer compiles due to a "freetype" version dependency issue. Xonclock is no longer being developed, so it likely won't ever work again.

widget analog clock free download


DOWNLOAD https://0grananotritru.blogspot.com/?tzg=2x6Yvy



Two things did work however and one surprised me: Cairo-clock (which is in the community repositories) and the Opera Widget "Analog Clock" (advertised as "Simple Analog Clock" or something close to that -- it's their most popular analog clock widget).

I ran TOP under identical conditions, once using cairo-clock and once using the Opera widget. I did it several times to be sure. I saved the output as text and compared them in Meld -- here's a link to my screenshot of THAT: As you can see, cairo-clock uses three times the CPU resources -- though somewhat less memory.

It took me a while to figure out that you use the "Always underneath" option in the Opera widget to keep it from having a window button in the panel -- but now, I seem to have a happy ending to this little Linux story (except that I hate Opera as a browser).

Last year I went through a similar search for a good simple low-resource using analog clock. I eventually went with xclock - once I did a complete overhall in .Xdefaults to get it to look half decent. But I also learned, while experimenting with cairo-clock, that changing the update interval has a massive impact on its resource use. I threw cairo-clock away sever times as I couldn't believe when I started it up it used (and continued to use) around 15% of my CPU and a large hunk of memory. But by changing the refresh interval to something more reasonable, I got the resource use down to be comparable with many other clocks.

Someone recently posted an Idea for the development of a clock widget for Dashboards. As neat as that would be, I couldn't help wondering, "could we make our own using the tools already available?"

If you implemented your clock with these expressions, though, you'd see your hour hand make a drastic jump when the hour changes, and that's just now how clocks work! We should see the hour hand gradually increment towards the next hour.

What about minutes? Don't they partially increment, too? I suppose they do. I don't know that anyone's going to be watching my clock widget that closely, but supposing they were, I want to reward their attention to detail with some details.

Also, for the sake of being thorough: in the span of a single hour on the clock (30 degrees), each second accounts for an additional... 0.008333 degrees? Best leave this one as a fraction. It's 1/120 of a degree.

For an analog clock, we don't really need to worry about AM vs PM. An hour value of 14 (2:00 PM) gives us a rotation of 420 degrees, which is equivalent to a rotation of 60 degrees as far as the circle of the clock is concerned.

This is all well and good, but it's just a FeatureSet right now, and a far cry from a nice analog clock. How do we turn this into something visual? I had initially tried to misuse an existing widget, like a circular progress meter or a pie chart. Ultimately, these did not work well enough to pass as a standard clock, but did make for interesting widgets.

Our single requirement is that we be able to access the HTML source editing and be able to pipe in attributes, which pretty much just leaves us with the List widget. Nothing else gives us both.

I started this just to see if I could do it, and if the end result could actually look nice in addition to being functional. I'm pretty pleased with it. But maybe you don't want a clock in your dashboard, so why bother?

An Analog Clock is a widget that enables the display of a classic analog watch, as opposed to the DigitalClock which displays time with text. The clock uses a background image as the clock face. The hour, minute and second hands are each using an image and rotate around a configurable center.

To update the time displayed by the clock, one of the following functions can be used.
setTime24Hour(uint8_t hour, uint8_t minute, uint8_t second)
setTime12Hour(uint8_t hour, uint8_t minute, uint8_t second, bool am)

I'm using the builtin AnalogClock widget in my activity layout. I'd like to make it bigger. Adjusting the layout_width and layout_height doesn't seem to make a difference. Is there a simple way to do this?

The default Analog clock has dial pad which is of 231 * 231 in HDPI. Even you mention the width and height of the AnalogClock more, these Images are not stretched. To show the AnalogClock bigger, provide your own dial pad and minutes hand and hours hand with custom dimensions.

I found that the previous answers didn't work for me. I found a simple solution. Just create your own custom drawable for the clock's background, and set the android:dial attribute. You can create your drawable as large as you need. Surely if you want your clock to look pretty you must create two drawables for hours and minutes too. You can simply copy default drawable(s) to somewhere and resize them with an image editor:

The built in AnalogClock widget was deprecated. The minimum interval for a JobScheduler is 15 minutes, and may not run at all on some devices that have OEM background restrictions. A foreground service seems like the only option.

So I got impatient and decompiled the app. They still use AnalogClock and it seems to work and self update, even though it is deprecated since API 23 and Google has stated "This widget is no longer supported." in the docs. The custom faces and hands are drawables set on the AnalogClock. There are no ImageViews involved (at least for what I saw)

You can't make the widget change from analogue to digital, but you can replace the analogue one from a digital one. Hold your finger on the clock widget and drag it to the delete icon to remove it. Then, to add a digital clock widget, go to the app drawer and click Widgets, and find Digital clock in the list. Hold your finger on the digital clock to pick it up, and drag it where you like on the home screen.

There are several widgets to be used in KDE Plasma that will let you display the time on your desktop screen. These can be added directly onto the desktop or into the panel as well. This applies to all widgets, of course.

By default, there is one clock widget on the right of the control panel. In this document, we will concentrate on this clock. However, everything said is also valid for clock widgets that are added onto the desktop directly.

The AnalogClock class provides a clock widget with hour and minute hands that is automatically updated every few seconds. We subclass QWidget and reimplement the standard paintEvent() function to draw the clock face:

When the widget is constructed, we set up a one-second timer to keep track of the current time, and we connect it to the standard update() slot so that the clock face is updated when the timer emits the timeout() signal.

The paintEvent() function is called whenever the widget's contents need to be updated. This happens when the widget is first shown, and when it is covered then exposed, but it is also executed when the widget's update() slot is called. Since we connected the timer's timeout() signal to this slot, it will be called at least once every five seconds.

Before we set up the painter and draw the clock, we first define two lists of QPoints and two QColors that will be used for the hour and minute hands. The minute hand's color has an alpha component of 191, meaning that it's 75% opaque.

The contents of custom widgets are drawn with a QPainter. Painters can be used to draw on any QPaintDevice, but they are usually used with widgets, so we pass the widget instance to the painter's constructor.

The translation moves the origin to the center of the widget, and the scale operation ensures that the following drawing operations are scaled to fit within the widget. We use a scale factor that let's us use x and y coordinates between -100 and 100, and that ensures that these lie within the length of the widget's shortest side.

The painter takes care of all the transformations made during the paint event, and ensures that everything is drawn correctly. Letting the painter handle transformations is often easier than performing manual calculations just to draw the contents of a custom widget.

We draw the hour hand first, using a formula that rotates the coordinate system counterclockwise by a number of degrees determined by the current hour and minute. This means that the hand will be shown rotated clockwise by the required amount.

Just a heads up when you upgrade to 4.0, if you use digital clocks in your layouts they turn into Analog clocks. The only thing you can do is delete the widget and replace it with the correct one. Not a big deal but worth knowing.

Having a prominent and easily accessible digital clock on your iPhone or iPad Home Screen can be incredibly useful, especially if you have poor eyesight. In this short tutorial, we will guide you through the steps of adding a big digital clock widget to your device, ensuring you never lose track of time.

35fe9a5643
Reply all
Reply to author
Forward
0 new messages