Skip to content

Commit 1b297da

Browse files
authored
Merge pull request #9 from lucasriechelmann/main
Fixed bug in Rename TextBox not showing the text
2 parents 9924e07 + ffca7fd commit 1b297da

File tree

3 files changed

+25
-22
lines changed

3 files changed

+25
-22
lines changed

src/SQLScriptsExplorer.Addin/Controls/FileExplorerTreeView.xaml

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -39,20 +39,26 @@
3939
Height="16"
4040
Margin="3,0,5,0"
4141
Source="{Binding Icon}" />
42-
<local:HighlightTextBlock
43-
HighlightBrush="Khaki"
44-
HighlightPhrase="{Binding Path=HighlightPhrase, Mode=TwoWay}"
45-
IsCaseSensitive="False"
46-
IsHitTestVisible="False"
47-
Text="{Binding Path=FileName}" />
48-
<TextBox
49-
x:Name="txtRename"
50-
Width="Auto"
51-
HorizontalAlignment="Center"
52-
KeyDown="txtRename_KeyDown"
53-
LostFocus="txtRename_LostFocus"
54-
Text="{Binding FileName, Mode=TwoWay}"
55-
Visibility="Collapsed" />
42+
<Grid>
43+
<local:HighlightTextBlock
44+
Grid.Row="0"
45+
HighlightBrush="Khaki"
46+
HighlightPhrase="{Binding Path=HighlightPhrase, Mode=TwoWay}"
47+
IsCaseSensitive="False"
48+
IsHitTestVisible="False"
49+
Text="{Binding Path=FileName}" />
50+
<TextBox
51+
x:Name="txtRename"
52+
Grid.Row="0"
53+
Width="Auto"
54+
Height="Auto"
55+
Padding="0"
56+
HorizontalAlignment="Center"
57+
KeyDown="txtRename_KeyDown"
58+
LostFocus="txtRename_LostFocus"
59+
Text="{Binding FileName, Mode=TwoWay}"
60+
Visibility="Collapsed" />
61+
</Grid>
5662
</StackPanel>
5763
</HierarchicalDataTemplate>
5864

@@ -257,20 +263,15 @@
257263
<Setter TargetName="PART_Header" Property="MinHeight" Value="19" />
258264
</MultiTrigger>
259265
<Trigger Property="IsSelected" Value="true">
260-
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}" />
261-
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}" />
266+
<Setter TargetName="Bd" Property="Background" Value="#45b3e0" />
262267
</Trigger>
263268
<MultiTrigger>
264269
<MultiTrigger.Conditions>
265270
<Condition Property="IsSelected" Value="true" />
266271
<Condition Property="IsSelectionActive" Value="false" />
267272
</MultiTrigger.Conditions>
268-
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" />
269-
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
273+
<Setter TargetName="Bd" Property="Background" Value="#45b3e0" />
270274
</MultiTrigger>
271-
<Trigger Property="IsEnabled" Value="false">
272-
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
273-
</Trigger>
274275
</ControlTemplate.Triggers>
275276
</ControlTemplate>
276277
</Setter.Value>

src/SQLScriptsExplorer.Addin/Controls/HighlightTextBlock.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ void ApplyThemeColors()
7373
DrawingColor foreground = VSColorTheme.GetThemedColor(EnvironmentColors.ToolWindowTextColorKey);
7474
DrawingColor background = VSColorTheme.GetThemedColor(EnvironmentColors.ToolWindowBackgroundColorKey);
7575
Foreground = new SolidColorBrush(Color.FromArgb(foreground.A, foreground.R, foreground.G, foreground.B));
76-
Background = new SolidColorBrush(Color.FromArgb(background.A, background.R, background.G, background.B));
76+
//Background = new SolidColorBrush(Color.FromArgb(background.A, background.R, background.G, background.B));
77+
Background = Brushes.Transparent; // Keep background transparent to allow highlighting to show through
7778
}
7879
void VSColorTheme_Changed(ThemeChangedEventArgs e)
7980
{

src/SQLScriptsExplorer.Addin/SQLScriptsExplorer.Addin.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@
261261
<EmbeddedResource Include="Properties\Resources.resx">
262262
<Generator>ResXFileCodeGenerator</Generator>
263263
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
264+
<SubType>Designer</SubType>
264265
</EmbeddedResource>
265266
<EmbeddedResource Include="frmSettings.resx">
266267
<DependentUpon>frmSettings.cs</DependentUpon>

0 commit comments

Comments
 (0)