question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Theme: When setting interface width wider in theme, the right hand side will be cut off.

See original GitHub issue

image

I want to make the result of dictionary plugin wider. So, I specify the width in the xaml file as I usually do in wox theme. Setting the width property of WindowBorderStyle used to do the job, yet I can’t achieve the same result.

Here is the default width.

image

By the way, I also try to align the query box with the list box, but didn’t success. Any suggestion to achieve this result?

Here is the theme.

<?xml version="1.0" encoding="UTF-8"?>
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="Base.xaml" />
    </ResourceDictionary.MergedDictionaries>
    <Style x:Key="QueryBoxStyle" BasedOn="{StaticResource BaseQueryBoxStyle}" TargetType="{x:Type TextBox}">
        <Setter Property="Background" Value="#1a1a1a" />
        <Setter Property="Foreground" Value="#ffffff" />
        <Setter Property="FontSize" Value="28" />
        <Setter Property="Padding" Value="24, 8, 24, 8" />
        <Setter Property="Height" Value="64" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TextBox}">
                    <Border x:Name="border" BorderBrush="#1a1a1a" CornerRadius="6" BorderThickness="3" Background="#1a1a1a" SnapsToDevicePixels="True">
                        <Border.Effect>
                            <DropShadowEffect BlurRadius="12" ShadowDepth="0" Opacity="0.9" Color="#000000" />
                        </Border.Effect>
                        <ScrollViewer x:Name="PART_ContentHost" Focusable="false" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"
                                      Background="{TemplateBinding Background}">
                            <ScrollViewer.ContentTemplate>
                                <DataTemplate>
                                    <Grid Background="{Binding Background, ElementName=PART_ContentHost}" RenderOptions.ClearTypeHint="Enabled">
                                        <ContentPresenter Content="{Binding Path=Content, ElementName=PART_ContentHost}"></ContentPresenter>
                                    </Grid>
                                </DataTemplate>
                            </ScrollViewer.ContentTemplate>
                        </ScrollViewer>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="QuerySuggestionBoxStyle" BasedOn="{StaticResource BaseQuerySuggestionBoxStyle}" TargetType="{x:Type TextBox}">
        <Setter Property="Background" Value="#1a1a1a" />
        <Setter Property="Foreground" Value="#bcbcbc" />
        <Setter Property="FontSize" Value="28" />
        <Setter Property="Padding" Value="24, 8, 24, 8" />
        <Setter Property="Height" Value="64" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TextBox}">
                    <!-- BG of SearchBox -->
                    <Border x:Name="border" BorderBrush="#1a1a1a" CornerRadius="6" BorderThickness="3" Background="#1a1a1a" SnapsToDevicePixels="True">
                        <Border.Effect>
                            <DropShadowEffect BlurRadius="12" ShadowDepth="0" Opacity="0.9" Color="#000000" />
                        </Border.Effect>
                        <ScrollViewer x:Name="PART_ContentHost" Focusable="false" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"
                                      Background="{TemplateBinding Background}">
                            <ScrollViewer.ContentTemplate>
                                <DataTemplate>
                                    <Grid Background="{Binding Background, ElementName=PART_ContentHost}" RenderOptions.ClearTypeHint="Enabled">
                                        <ContentPresenter Content="{Binding Path=Content, ElementName=PART_ContentHost}"></ContentPresenter>
                                    </Grid>
                                </DataTemplate>
                            </ScrollViewer.ContentTemplate>
                        </ScrollViewer>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="WindowBorderStyle" BasedOn="{StaticResource BaseWindowBorderStyle}" TargetType="{x:Type Border}">
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="Width" Value="1000" />
    </Style>
    
    <Style x:Key="WindowStyle" TargetType="{x:Type Window}" BasedOn="{StaticResource BaseWindowStyle}" />
    <Style x:Key="PendingLineStyle" BasedOn="{StaticResource BasePendingLineStyle}" TargetType="{x:Type Line}" />
    <Style x:Key="ItemTitleStyle" BasedOn="{StaticResource BaseItemTitleStyle}" TargetType="{x:Type TextBlock}">
        <Setter Property="Margin" Value="5, 0"/>
        <Setter Property="Foreground" Value="#dddddd" />
    </Style>
    <Style x:Key="ItemSubTitleStyle" BasedOn="{StaticResource BaseItemSubTitleStyle}" TargetType="{x:Type TextBlock}">
        <Setter Property="Margin" Value="5, 0"/>
        <Setter Property="Foreground" Value="#bcbcbc" />
    </Style>
    <Style x:Key="ItemTitleSelectedStyle" BasedOn="{StaticResource BaseItemTitleSelectedStyle}" TargetType="{x:Type TextBlock}">
        <Setter Property="Margin" Value="5, 0"/>
        <Setter Property="Foreground" Value="#FFFFF8" />
    </Style>
    <Style x:Key="ItemSubTitleSelectedStyle" BasedOn="{StaticResource BaseItemSubTitleSelectedStyle}" TargetType="{x:Type TextBlock}">
        <Setter Property="Margin" Value="5, 0"/>
        <Setter Property="Foreground" Value="#D9D9D4" />
    </Style>
    <SolidColorBrush x:Key="ItemSelectedBackgroundColor">#444444</SolidColorBrush>
    
    <Style x:Key="BaseListboxStyle" TargetType="{x:Type ListBox}">
        <Setter Property="BorderBrush" Value="Transparent" />
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled" />
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ListBox">
                    <!-- BG of SearchBox -->
                    <Border x:Name="border" BorderBrush="#1a1a1a" CornerRadius="6" BorderThickness="3" Background="#1a1a1a" SnapsToDevicePixels="True">
                        <Border.Effect>
                            <DropShadowEffect BlurRadius="12" ShadowDepth="0" Opacity="0.9" Color="#000000" />
                        </Border.Effect>
                        <ScrollViewer Focusable="false" Template="{DynamicResource ScrollViewerControlTemplate}">
                            <VirtualizingStackPanel IsItemsHost="True" />
                        </ScrollViewer>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <Style x:Key="ThumbStyle" BasedOn="{StaticResource BaseThumbStyle}" TargetType="{x:Type Thumb}" />
    <Style x:Key="ScrollBarStyle" BasedOn="{StaticResource BaseScrollBarStyle}" TargetType="{x:Type ScrollBar}" />
</ResourceDictionary>

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
taooceroscommented, Mar 5, 2021

@jjw24 There is another issue, that the distribution of the resultview is hardcoding, so after changing the width, the alt+n will distribution on the wrong place. We also need to address that issue.

1reaction
Scutum-Lcommented, Mar 4, 2021

Sorry for the late reply. Turns out I didn’t restart flow after adjusting the width of WindowStyle. I used to switch theme in setting to make any adjustment in my custom theme appear.

The result is great! It works as my expectation. image (I exaggerate the width increment in order to make the adjustment more clear in screenshot.)

This is original width without any adjustment. image

I think that the adjustment with width makes the experience on 4k monitor way more better. Really thanks a lot. Hope this function will exist in the future official release.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Loading glitch for full-width stretched sections
It first shows white spaces on either side of the section and then fills the full width of that. I have tried it...
Read more >
Moodle 4 and Boost customisation - Themes
I am a little puzzled about the reduced width and would like to know if it takes much CSS to go full width?...
Read more >
How do I increase the resize margin on windows?
As others have mentioned, it depends on the theme. Try a few out. What I frequently do instead is hold down Alt and...
Read more >
Variations On A Theme - Reaper
The master fader is displayed on the right-hand side of the mixer in this example. This is achieved by right-clicking on the Mixer...
Read more >
Change the look of your SharePoint site
Use a theme to change the colors of your SharePoint site · On your site, click Settings · Select the look you want....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found