Fix how Picture[] interprets relative paths.

[GB.GUI.BASE]
* BUG: Fix how Picture[] interprets relative paths.
This commit is contained in:
gambas 2020-01-14 14:19:41 +01:00
parent ba221177da
commit 2deeab7410

View file

@ -48,6 +48,7 @@ Static Public Sub _get(Path As String) As Picture
Dim sPath As String Dim sPath As String
Dim sBaseName As String Dim sBaseName As String
Dim sDarkPath As String Dim sDarkPath As String
Dim bMoveUp As Boolean
If Not Path Then Return If Not Path Then Return
@ -65,8 +66,17 @@ Static Public Sub _get(Path As String) As Picture
sPath = Path sPath = Path
If File.IsRelative(sPath) And If sPath Not Begins "./" Then sPath = ".." &/ sPath If File.IsRelative(sPath) Then
'Debug Path;; System.Backtrace.Join(" ") If sPath Begins "./" Then
If sPath Not Begins "./gb." Then
bMoveUp = True
Endif
Else
bMoveUp = True
Endif
Endif
If bMoveUp Then sPath = ".." &/ sPath
' Support for rtl/ltr icons ' Support for rtl/ltr icons