Archive

Posts Tagged ‘Sidebar’

New: margu-NotebookInfo2 Version 2.2.4

June 8th, 2010 margu 14 comments

Only a small update because I’m heavy employed the last month.

This update adds support for danish and hungarian language. Further you can add parameters to program calls for the calendar app.

As usual you can download the update on my Download Page.


Little bug in 2.1.3

August 14th, 2009 margu 2 comments

There is a little bug in this release which makes the gadget a bit stuck all 10 to 15 seconds.

It is a timeout value which I set wrong. This will be fixed in next release.

If you want to fix it yourself for now, got to

C:\Users\<USER>\AppData\Local\Microsoft\Windows Sidebar\Gadgets\margu-NotebookInfo2.gadget\js\

folder (where <USER> is your username) and open the file gadget.js in your editor.

Search for the line

if (xrefDiff > 2) //after hibernate or suspend

(it is line 633) and replace the 2 with 120000.
Afterwards the line should look like

if (xrefDiff > 120000) //after hibernate or suspend

Then save the file and restart the sidebar.

Sorry for the bug. :)

Da ist ein kleiner Fehler in dieser Version wodurch das Gadget alle 10 bis 15 Sekunden für einen kleinen Moment hängen bleibt.

Es ist eine Timeout variable falsch gesetzt. Das wird im nächsten Release behoben sein.

Wenn Du es jetzt schonmal selbst korrigieren willst, gehe in den Ordner

C:\Benutzer\<USER>\AppData\Local\Microsoft\Windows Sidebar\Gadgets\margu-NotebookInfo2.gadget\js\

(dabei ist <USER> Dein Benutzername) und öffne die Datei gadget.js in Deinem Editor.

Suche nach der Zeile

if (xrefDiff > 2) //after hibernate or suspend

(es ist Zeile 633) und ersetze die 2 mit 120000.
Hinterher sollte die Zeile folgendermaßen aussehen

if (xrefDiff > 120000) //after hibernate or suspend

Dann speichere die Datei und starte die Sidebar neu.

Entschuldigt den Fehler. :)

New: Version 2.1.2 of margu-NotebookInfo2

August 11th, 2009 margu No comments

Gadgets with transparent background

August 7th, 2009 margu No comments


transparent gadget

transparent gadget

There again Microsoft afforded something. Who of you already tried to provide a gadget with transparent background but not to do it without CSS formatting, tear one’s hair.


It is simply impossible to put a transparent picture on the background and finish. As soon as I want to place a second semi-transparent image on top or simply write some text into the gadget, I’ll have a cute secondary effect: All will get a neat magenta coloured border (as you can see on the picture).

This results on a bug in the anti-aliasing engine of the sidebar, which causes problems with alpha-cannels. Microsoft use a magenta coloured mask for transparency in sidebar and this won’t be erased completely if using semi-transparency. Thus these develop nice edges with the anti-aliasing of images or text.

You can minimise this on images, by putting only e.g. GIF files on top of PNG background images (who don’t use semi-transparent images on top can use e.g. JPG either), because only PNG use alpha-cannels. But the problem with the text remains existing.

However, Microsoft provide us one alternative method, as we can use the Tag <g:background ... > or the JavaScript variant addImageObject() . For this, either take a look at MSDN g:background Element.

Example:

<html>
    <head>
        <title>Hello World</title>
        <script type="text/jscript" language="jscript">
        function init()
        {
            System.Gadget.background = "images\\background.png";
        }
        </script>
    </head>

    <body onload="init()">
        <g:background id="imgBackground">
            Hello World!
        </g:background>
    </body>
</html>


The crucial disadvantage of this possibility is that thereby no events – like e.g. mouse click or mouse movement – are passed on, since images merged in such a way becomes part of the background.

Now my consideration goes by, whether I will really do myself this cramp and converts my gadget completely, or try to go around the restrictions with cheats so that all functions remain and I nevertheless get a transparent background. :schulterzuck:


Da hat sich Microsoft ja mal wieder was geleistet. Wer von Euch schonmal versucht hat ein Gadget mit transparentem Hintergrund zu erstellen und dabei auf CSS Formatierung nicht verzichten möchte, der rauft sich die Haare.

Es ist schlicht unmöglich einfach nur eine transparente Grafik zu nehmen, diese auf den Hintergrund zu legen und fertig. Sobald ich eine weitere Grafik mit semi-transparenten Teilen darüber lege oder auch einfach nur Schrift ins Gadget einfüge, bekomme ich einen netten Nebeneffekt, über den sich unser großes T hier in Deuschland sicher freut: Alles bekommt einen netten Rand in Magenda (auf der nebenstehenden Grafik zu sehen).

Das liegt an einem Bug der Anti-Aliasing Engine der Sidebar, der Probleme mit den Alphakanälen hat. Microsoft verwendet für die Transparenz bei der Sidebar eine magentafarbene Maske, die bei Teiltransparenz nicht vollständig entfernt wird. Dadurch entstehen beim Anti-Aliasing von Grafiken oder Schriften diese netten Ränder.

Vermindern läßt sich das bei Grafiken, indem man über den aus einer transparenten PNG Grafik bestehenden Hintergrund nur z.B. GIF Dateien legt (wer auf transparente Grafiken verzichten kann, kann auch z.B. JPG nutzen), weil nur PNG Alphakanäle unterstützt. Aber das Problem bei den Schriften bleibt weiter bestehen.

Eine (proprietäre) Alternative liefert Microsoft uns aber gleich mit, indem wir den Tag <g:background ... > oder die JavaScript Variante addImageObject() nutzen. Siehe dazu auch MSDN g:background Element.

Beispiel:

<html>
    <head>
        <title>Hello World</title>
        <script type="text/jscript" language="jscript">
        function init()
        {
            System.Gadget.background = "images\\background.png";
        }
        </script>
    </head>

    <body onload="init()">
        <g:background id="imgBackground">
            Hello World!
        </g:background>
    </body>
</html>


Der entscheidende Nachteil dieser Möglichkeit ist, daß dadurch keine Ereignisse – wie z.B. Mausklick oder -bewegung – weitergeleitet werden, da die so eingebundene Grafik Teil des Hintergrundes wird.

Nun geht meine Überlegung dahin, ob ich mir wirklich diesen Krampf antun werde und mein Gadget komplett umbaue, mit Tricks versuche die Einschränkungen zu umgehen, damit alle Funktionen erhalten bleiben und ich trotzdem einen transparenten Hintergrund bekomme. :schulterzuck:


New: Version 2.1.1 of margu-NotebookInfo2

August 4th, 2009 margu No comments

A few fixes and changes I’ve done in this release. The problem with remaining battery time if it is collected from Windows is nearly fixed. No problems if using Windows7 but working with Vista is hard, because Microsoft didn’t implement the System.Machine.PowerStatus.batteryCapacityRemaining in Vista for the sidebar. :wall:

I did a hack so now it works with Vista but stuck every 15 seconds. :(

If you check the box on the settings page for self calculating remaining batterytime all is working well.

As usual all changes you’ll find in changelog.


Ein paar Fehlerkorrekturen und Änderungen habe ich in dieser Version eingebaut. Das Problem mit der Restlaufzeit des Akku wenn der Wert aus Windows herausgeholt wird ist annähernd behoben. Unter Windows7 funktioniert alles tadellos, aber mit Vista ist es schwer, weil Microsoft wohl vergessen hat das System.Machine.PowerStatus.batteryCapacityRemaining in Vista für die Sidebar zu aktivieren. :wall:

Ich habe das nun notdürftig geflickt, so daß es unter Vista einigermaßen funktioniert, aber alle 15 Sekunden hängt das Gadget kurz. :(

Ganz ohne Probleme läuft alles, wenn in den Gadget Settings der Haken gesetzt wird, daß die Restlaufzeit vom Gadget berechnet werden soll.

Die Änderungen in dieser Version findest Du wie immer im Changelog.