Automatic flipping of some icons when system language is right-to-left written.
[GB.FORM.STOCK] * NEW: Automatic flipping of some icons when system language is right-to-left written.
|
@ -6,6 +6,7 @@ Class Image
|
|||
Class SvgImage
|
||||
|
||||
Static Private $cSynonymous As New Collection
|
||||
Static Private $cRightToLeft As Collection
|
||||
|
||||
Static Private $bDebug As Boolean
|
||||
|
||||
|
@ -34,17 +35,45 @@ Static Private Sub Stretch(hImage As Image, iSize As Integer) As Image
|
|||
|
||||
End
|
||||
|
||||
Static Private Sub LoadIcon(sKey As String, iSize As Integer, sStock As String) As Image
|
||||
|
||||
Dim sPath As String
|
||||
Static Private Sub LoadRightToLeft()
|
||||
|
||||
sPath = sStock &/ CStr(iSize) &/ sKey
|
||||
If System.RightToLeft And If Exist(sPath & "-rtl.png") Then sPath &= "-rtl"
|
||||
If $bDebug And If iSize = 32 And If Not Exist(sPath & ".png") Then Error "gb.form.stock: unknown icon: " & sKey
|
||||
Return Image.Load(sPath & ".png")
|
||||
Dim sKey As String
|
||||
|
||||
$cRightToLeft = New Collection
|
||||
For Each sKey In Split(File.Load("no-reverse"), "\n")
|
||||
sKey = Trim(sKey)
|
||||
If Not sKey Then Continue
|
||||
If sKey Begins ";" Then Continue
|
||||
$cRightToLeft[sKey] = True
|
||||
Next
|
||||
|
||||
End
|
||||
|
||||
Static Private Sub LoadIcon(sKey As String, iSize As Integer, sStock As String) As Image
|
||||
|
||||
Dim sPath As String
|
||||
Dim hImage As Image
|
||||
Dim bMirror As Boolean
|
||||
|
||||
sPath = sStock &/ CStr(iSize) &/ sKey
|
||||
If $bDebug And If iSize = 32 And If Not Exist(sPath & ".png") Then Error "gb.form.stock: unknown icon: " & sKey
|
||||
'If System.RightToLeft And If Exist(sPath & "-rtl.png") Then sPath &= "-rtl"
|
||||
If System.RightToLeft Then
|
||||
If Not $cRightToLeft Then LoadRightToLeft
|
||||
If $cRightToLeft.Exist(sKey) Then
|
||||
If Exist(sPath & "-rtl.png") Then
|
||||
sPath &= "-rtl"
|
||||
Else
|
||||
bMirror = True
|
||||
Endif
|
||||
Endif
|
||||
Endif
|
||||
|
||||
hImage = Image.Load(sPath & ".png")
|
||||
If bMirror Then hImage = hImage.Mirror(True, False)
|
||||
Return hImage
|
||||
|
||||
End
|
||||
|
||||
Static Public Sub LoadImage(sKey As String, iSize As Integer, Optional sStock As String) As Image
|
||||
|
||||
|
|
Before Width: | Height: | Size: 258 B |
Before Width: | Height: | Size: 168 B |
BIN
comp/src/gb.form.stock/gambas-mono/32/shopping.png
Normal file
After Width: | Height: | Size: 352 B |
Before Width: | Height: | Size: 371 B After Width: | Height: | Size: 418 B |
Before Width: | Height: | Size: 164 B |
BIN
comp/src/gb.form.stock/gambas-mono/32/today.png
Normal file
After Width: | Height: | Size: 223 B |
Before Width: | Height: | Size: 168 B |
BIN
comp/src/gb.form.stock/gambas-mono/32/zoom-normal-rtl.png
Normal file
After Width: | Height: | Size: 494 B |
BIN
comp/src/gb.form.stock/gambas/128/shopping.png
Normal file
After Width: | Height: | Size: 868 B |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 258 B |
Before Width: | Height: | Size: 168 B |
BIN
comp/src/gb.form.stock/gambas/32/shopping.png
Normal file
After Width: | Height: | Size: 352 B |
Before Width: | Height: | Size: 354 B After Width: | Height: | Size: 429 B |
Before Width: | Height: | Size: 166 B After Width: | Height: | Size: 166 B |
Before Width: | Height: | Size: 164 B |
BIN
comp/src/gb.form.stock/gambas/32/today.png
Normal file
After Width: | Height: | Size: 246 B |
Before Width: | Height: | Size: 168 B |
BIN
comp/src/gb.form.stock/gambas/32/zoom-normal-rtl.png
Normal file
After Width: | Height: | Size: 494 B |
98
comp/src/gb.form.stock/no-reverse
Normal file
|
@ -0,0 +1,98 @@
|
|||
attach
|
||||
audio
|
||||
battery
|
||||
bicycle
|
||||
bookmark
|
||||
brush
|
||||
call
|
||||
clear
|
||||
cloud
|
||||
color-picker
|
||||
computer
|
||||
connect
|
||||
copy
|
||||
crop
|
||||
cut
|
||||
desktop
|
||||
development
|
||||
difference
|
||||
disconnect
|
||||
download
|
||||
draw-arrow
|
||||
draw-line
|
||||
draw-path
|
||||
edit
|
||||
energy
|
||||
erase
|
||||
exclusive
|
||||
fill
|
||||
find
|
||||
group
|
||||
hardware
|
||||
hatch
|
||||
highlight
|
||||
indent
|
||||
internet
|
||||
intersection
|
||||
join-bevel
|
||||
join-miter
|
||||
join-round
|
||||
key
|
||||
keyboard
|
||||
language
|
||||
layout
|
||||
link
|
||||
lower
|
||||
monitor
|
||||
muted
|
||||
options
|
||||
pen
|
||||
people
|
||||
pin
|
||||
plane
|
||||
plugin
|
||||
pointer
|
||||
preview
|
||||
raise
|
||||
rename
|
||||
replace
|
||||
scanner
|
||||
science
|
||||
shopping
|
||||
sort-ascent
|
||||
sort-descent
|
||||
statistics
|
||||
tablet
|
||||
template
|
||||
text-baseline
|
||||
text-bigger
|
||||
text-bottom
|
||||
text-line-spacing
|
||||
text-list
|
||||
text-list-order
|
||||
text-middle
|
||||
text-smaller
|
||||
text-top
|
||||
tools
|
||||
town
|
||||
transparency
|
||||
trash-full
|
||||
unindent
|
||||
union
|
||||
unlock
|
||||
user-group
|
||||
view-detail
|
||||
view-tree
|
||||
volume-high
|
||||
volume-low
|
||||
volume-medium
|
||||
volume
|
||||
walk
|
||||
window
|
||||
wizard
|
||||
wrap
|
||||
zoom-fit
|
||||
zoom-in
|
||||
zoom-normal
|
||||
zoom-out
|
||||
zoom-width
|