Initial community commit
This commit is contained in:
parent
537bcbc862
commit
fc06254474
16440 changed files with 4239995 additions and 2 deletions
BIN
Src/resources/data/freeform/xml/tooltips/tooltips-elements.png
Normal file
BIN
Src/resources/data/freeform/xml/tooltips/tooltips-elements.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 142 B |
|
@ -0,0 +1,12 @@
|
|||
<elements>
|
||||
<bitmap id="wasabi.tooltip.top.left" file="tooltips-elements.png" x="0" y="0" h="4" w="4" gammagroup="Tooltips Background"/>
|
||||
<bitmap id="wasabi.tooltip.top" file="tooltips-elements.png" x="4" y="0" h="4" w="8" gammagroup="Tooltips Background"/>
|
||||
<bitmap id="wasabi.tooltip.top.right" file="tooltips-elements.png" x="13" y="0" h="4" w="4" gammagroup="Tooltips Background"/>
|
||||
<bitmap id="wasabi.tooltip.left" file="tooltips-elements.png" x="0" y="4" h="8" w="4" gammagroup="Tooltips Background"/>
|
||||
<bitmap id="wasabi.tooltip.center" file="tooltips-elements.png" x="4" y="4" h="8" w="8" gammagroup="Tooltips Background"/>
|
||||
<bitmap id="wasabi.tooltip.right" file="tooltips-elements.png" x="13" y="4" h="8" w="4" gammagroup="Tooltips Background"/>
|
||||
<bitmap id="wasabi.tooltip.bottom.left" file="tooltips-elements.png" x="0" y="13" h="4" w="4" gammagroup="Tooltips Background"/>
|
||||
<bitmap id="wasabi.tooltip.bottom" file="tooltips-elements.png" x="4" y="13" h="4" w="8" gammagroup="Tooltips Background"/>
|
||||
<bitmap id="wasabi.tooltip.bottom.right" file="tooltips-elements.png" x="13" y="13" h="4" w="4" gammagroup="Tooltips Background"/>
|
||||
<color id="wasabi.tooltips.textcolor" value="0,0,0" gammagroup="Tooltips Text" />
|
||||
</elements>
|
34
Src/resources/data/freeform/xml/tooltips/tooltips.m
Normal file
34
Src/resources/data/freeform/xml/tooltips/tooltips.m
Normal file
|
@ -0,0 +1,34 @@
|
|||
#include <lib/std.mi>
|
||||
|
||||
Global Group tipGroup;
|
||||
Global Text tipText;
|
||||
|
||||
System.onScriptLoaded() {
|
||||
tipGroup = getScriptGroup();
|
||||
tipText = tipGroup.getObject("tooltip.text");
|
||||
}
|
||||
|
||||
// When text is changed, resize the group accordingly and make sure it's fully visible
|
||||
|
||||
tipText.onTextChanged(String newtext) {
|
||||
|
||||
int x = getMousePosX();
|
||||
int y = getMousePosY()-tipGroup.getHeight(); // move above mouse by default
|
||||
|
||||
int vpleft = getViewportLeftFromPoint(x, y);
|
||||
int vptop = getViewportTopFromPoint(x, y);
|
||||
int vpright = vpleft+getViewportWidthFromPoint(x, y);
|
||||
int vpbottom = vptop+getViewportHeightFromPoint(x, y);
|
||||
|
||||
int w = getAutoWidth()+20;
|
||||
int h = tipGroup.getHeight();
|
||||
|
||||
if (x + w > vpright) x = vpright - w;
|
||||
if (x < vpleft) x = vpleft;
|
||||
if (x + w > vpright) { w = vpright-vpleft-64; x = 32; }
|
||||
if (y + h > vpbottom) y = vpbottom - h;
|
||||
if (y < vptop) y = vptop + 32; // avoid mouse
|
||||
if (y + h > vpbottom) { h = vpbottom-vptop-64; y = 32; }
|
||||
|
||||
tipGroup.resize(x, y, w, h);
|
||||
}
|
BIN
Src/resources/data/freeform/xml/tooltips/tooltips.maki
Normal file
BIN
Src/resources/data/freeform/xml/tooltips/tooltips.maki
Normal file
Binary file not shown.
35
Src/resources/data/freeform/xml/tooltips/tooltips.xml
Normal file
35
Src/resources/data/freeform/xml/tooltips/tooltips.xml
Normal file
|
@ -0,0 +1,35 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<WinampAbstractionLayer version="0.7">
|
||||
|
||||
<include file="tooltips-elements.xml"/>
|
||||
|
||||
<groupdef id="wasabi.tooltip.group" h="17" noactivation="1">
|
||||
<grid
|
||||
id="tooltip.grid"
|
||||
x="0" y="0"
|
||||
w="-16" h="0"
|
||||
sysregion="1"
|
||||
relatw="1" relath="1"
|
||||
topleft="wasabi.tooltip.top.left"
|
||||
top="wasabi.tooltip.top"
|
||||
topright="wasabi.tooltip.top.right"
|
||||
left="wasabi.tooltip.left"
|
||||
middle="wasabi.tooltip.center"
|
||||
right="wasabi.tooltip.right"
|
||||
bottomleft="wasabi.tooltip.bottom.left"
|
||||
bottom="wasabi.tooltip.bottom"
|
||||
bottomright="wasabi.tooltip.bottom.right"
|
||||
/>
|
||||
<text
|
||||
id="tooltip.text"
|
||||
x="2" y="1"
|
||||
w="0" h="-2"
|
||||
relatw="1" relath="1"
|
||||
default="Tooltip Sample"
|
||||
font="Arial" fontsize="14" color="wasabi.tooltips.textcolor"
|
||||
/>
|
||||
<script id="tip" file="tooltips.maki"/>
|
||||
|
||||
</groupdef>
|
||||
|
||||
</WinampAbstractionLayer>
|
Loading…
Add table
Add a link
Reference in a new issue