Themes, where?

User avatar
Jellyfish
Posts: 13
Joined: Thu Mar 01, 2012 6:44 am

Re: Themes, where?

Post by Jellyfish »

ags wrote:You can also try http://www.kaxaml.com/
nice, i might actually start understanding all this text to art stuff :oops:

if you have illustrator:

http://www.mikeswanson.com/xamlexport/default.htm

User avatar
strobotone
Posts: 297
Joined: Wed Nov 23, 2011 2:59 pm
Location: berlin
Contact:

Re: Themes, where?

Post by strobotone »

interesting. thanks for the tip !

User avatar
strobotone
Posts: 297
Joined: Wed Nov 23, 2011 2:59 pm
Location: berlin
Contact:

Re: Themes, where?

Post by strobotone »

for those who dont wanna fiddle around with xaml,
i updated the simplon theme (for build 1467): http://strobotone.de/content/developmen ... n_3.41.zip

User avatar
outsider
Posts: 10
Joined: Fri Nov 25, 2011 2:55 am
Location: Uruguay
Contact:

Re: Themes, where?

Post by outsider »

Thank you very much.

User avatar
mcbpete
Posts: 318
Joined: Tue Nov 22, 2011 9:45 pm

Re: Themes, where?

Post by mcbpete »

strobotone - How do you 'call' the right click menu (and I guess the top as well) in the new builds? In older versions I just stole Jeskola's MachineMenu.xaml theme then in Parameterwindow.xaml I put in the following in the Window.resources section -

Code: Select all

			<ResourceDictionary.MergedDictionaries>
				<ResourceDictionary Source="MachineView/MachineMenu.xaml"/>
			</ResourceDictionary.MergedDictionaries>
But it doesn't appear to do anything since ~1455 when the right click menu/top menu code changed (to WPF ?).

User avatar
strobotone
Posts: 297
Joined: Wed Nov 23, 2011 2:59 pm
Location: berlin
Contact:

Re: Themes, where?

Post by strobotone »

i reorganized the files a bit.

take a look at Toolbar.xaml and MVResources.xaml :

<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Controls.xaml"/>
<ResourceDictionary Source="Menus/ContextMenu.xaml"/>
...

in MachineView.xaml you will find :
<ResourceDictionary Source="MVResources.xaml"/> then.

all styles for the controls (sliders, buttons...) are stored in Controls.xaml
and contextmenu-related stuff goes in ContextMenu.xaml.
so since we use the resources in different places we kinda have to put them into the same namespace.
otherwise the styles will not get overwritten.

hope that helps.

User avatar
mcbpete
Posts: 318
Joined: Tue Nov 22, 2011 9:45 pm

Re: Themes, where?

Post by mcbpete »

strobotone wrote:since we use the resources in different places we kinda have to put them into the same namespace.
otherwise the styles will not get overwritten.
Ahhhhh gotcha, no that makes perfect sense - Ok looks like I'm gonna have to reorganise my theme a bit then. Cheers man :)

User avatar
mcbpete
Posts: 318
Joined: Tue Nov 22, 2011 9:45 pm

Re: Themes, where?

Post by mcbpete »

OK, I'm nearly there (thanks for the hint, it was the mvresources xaml that I didn't think to update).

Feeling a bit stupid for not working this out but there's still a couple of issues I'm having for updating my theme:

a) Where is the location of the colours used for the 'typing machine name' list menu? (eg Effects come up red, Generators come out blue on the list, background white etc.). With the introduction of the wpf menu they've become a little unreadable so I want to tweak them a little. If I use 'SimpleStyles/TextBoxDark.xaml' in controls.xaml then I can see what I've selected (white highlight on black background) but the text is a little garish, and if I don't specify any xaml so it uses the default it's more readable but I can't see what I'm selecting (white highlight on white background)

b) Is it possible to make this 'machine list' list menu transparent as per the context menu that you have in your theme strobotone ?

User avatar
strobotone
Posts: 297
Joined: Wed Nov 23, 2011 2:59 pm
Location: berlin
Contact:

Re: Themes, where?

Post by strobotone »

a)
in MVResources.xaml you´ll find:

...
<DataTemplate x:Key="MachineListItemTemplate">
<TextBlock Name="tb" Text="{Binding Path=DisplayName}" Foreground="#d8d8d8" Padding="0,0,5,0"/>

<DataTemplate.Triggers>
<DataTrigger Binding="{Binding Path=Instrument.Type}" Value="Generator">
<Setter TargetName="tb" Property="Foreground" Value="{StaticResource GeneratorColor}"/>
</DataTrigger>
<DataTrigger Binding="{Binding Path=Instrument.Type}" Value="Effect">
<Setter TargetName="tb" Property="Foreground" Value="{StaticResource EffectColor}"/>
</DataTrigger>
...

the color resources are stored in Controls.xaml :

...
<!--Resources-->
<SolidColorBrush x:Key="GeneratorColor">#719cfe</SolidColorBrush>
<LinearGradientBrush x:Key="GeneratorGradient" StartPoint="0,1" EndPoint="1,1">
<GradientStop Color="#719cfe" Offset="0.4"/>
<GradientStop Color="#d0383838" Offset="0.9"/>
</LinearGradientBrush>
...

you get the picture :)

b)
yes.
meanwhile look out for opacity property.
if you wrap objects in a border or something similar you can use it as a container or to easily control transparency/opacity of its containing elements.
you can also make smooth transitions from 100% to 0% opacity if you like.
when i find the time i´ll explain it better.

User avatar
mcbpete
Posts: 318
Joined: Tue Nov 22, 2011 9:45 pm

Re: Themes, where?

Post by mcbpete »

You're a star - I'll have a tinker around this evening !

User avatar
strobotone
Posts: 297
Joined: Wed Nov 23, 2011 2:59 pm
Location: berlin
Contact:

Re: Themes, where?

Post by strobotone »

feel free to post a screenshot of your theme then :)

User avatar
mcbpete
Posts: 318
Joined: Tue Nov 22, 2011 9:45 pm

Re: Themes, where?

Post by mcbpete »

OK, I'm sorted for (a) but am waaaay out of my depth for (b) -

I can see I need to do something like the following (though am probably missing a considerable amount of vital lines, and I'm not entirely sure where I'd place the code !) :

Code: Select all

    <ControlTemplate x:Key="{x:Static MachineList}" TargetType="{x:Type MenuItem}">
        <Border x:Name="Border" Background="Transparent"
            BorderThickness="1" CornerRadius="2" Margin="2,0,6,0" >
        </Border>
    </ControlTemplate>
But one thing that's really holding me back is knowing the names of the x:Key elements and their associated x:Types (as you can probably tell with their probably not being an x:Key called MachineList !). How do you know what the names are of each of the Buzz gui elements without (as I do!) just grabbing them from other peoples themes ?

XAML appears to be a beast that I haven't entirely wrapped my head around yet...

EDIT - Actually I guess I could pretty my thieve this bit of code and add the transparency to the border section: viewtopic.php?f=3&t=271#p1696
Last edited by mcbpete on Tue Jul 24, 2012 3:48 pm, edited 1 time in total.

User avatar
mantratronic
Posts: 294
Joined: Mon Nov 21, 2011 7:23 pm

Re: Themes, where?

Post by mantratronic »

[quote="strobotone"][/quote]

care to comment? :D

(also i got screen grabs info and entry)

User avatar
strobotone
Posts: 297
Joined: Wed Nov 23, 2011 2:59 pm
Location: berlin
Contact:

Re: Themes, where?

Post by strobotone »

:P
have you been at the party?

i made this logo some time ago and since it never got used i contributed it as advertisement for buzz inside the demoscene.
cheers.

User avatar
mantratronic
Posts: 294
Joined: Mon Nov 21, 2011 7:23 pm

Re: Themes, where?

Post by mantratronic »

nah, i was sofascening :) got a fun shock when i saw the title come up. nice logo btw!

User avatar
strobotone
Posts: 297
Joined: Wed Nov 23, 2011 2:59 pm
Location: berlin
Contact:

Re: Themes, where?

Post by strobotone »

neat. the world is a small place :)

User avatar
mcbpete
Posts: 318
Joined: Tue Nov 22, 2011 9:45 pm

Re: Themes, where?

Post by mcbpete »

Aces, I managed to get the whole transparency machine list thing to work by using Oskari's code (mentioned in my previous post) for creating the themed QuickNewMachineWindow and bunging Opacity in the border section. i.e. putting this into MVResources.xaml:

Code: Select all


<Style TargetType="{x:Type local:QuickNewMachineWindow}">
      <Style.Resources>
         <Style x:Key="ItemStyle" TargetType="{x:Type ListBoxItem}">
            <Setter Property="bgc:CommandBehavior.Event" Value="MouseDoubleClick" />
            <Setter Property="bgc:CommandBehavior.Command" Value="{Binding ElementName=PART_Window, Path=SelectCommand}" />
            <Setter Property="bgc:CommandBehavior.CommandParameter" Value="{Binding}" />
         </Style>
      </Style.Resources>
      <Setter Property="AllowsTransparency" Value="True"/>
      <Setter Property="MinWidth" Value="200"/>
      <Setter Property="MinHeight" Value="323"/>
      <Setter Property="SizeToContent" Value="Width"/>
      <Setter Property="Template">
         <Setter.Value>
            <ControlTemplate TargetType="{x:Type local:QuickNewMachineWindow}">
               <Border BorderBrush="#c0111111" BorderThickness="2" CornerRadius="3" >
                  <Border Background="#e0080808" BorderBrush="#cccccc" BorderThickness="2" CornerRadius="3" Padding="2" Opacity="0.95">

                     <Grid>
                        <Grid.RowDefinitions>
                           <RowDefinition Height="24"/>
                           <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>

                        <Border Grid.Row="0" BorderBrush="#666" BorderThickness="1" CornerRadius="2" Margin="3">
                           <TextBox Name="PART_TextBox" BorderThickness="0" Background="#e3282828" Foreground="#eeeeee"/>
                        </Border>

                        <Border Grid.Row="1" BorderBrush="#666" BorderThickness="1" CornerRadius="2" Margin="3" Padding="2">
                           <ListBox Name="PART_ListBox" ItemsSource="{Binding Path=Items}" ItemContainerStyle="{StaticResource ItemStyle}" ItemTemplate="{StaticResource MachineListItemTemplate}"
                                        VirtualizingStackPanel.IsVirtualizing="True" BorderThickness="0" Padding="0,0,8,0">
                              <ListBox.Background>
                                 <LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
                                    <GradientStop Offset="0" Color="#e8080808"/>
                                    <GradientStop Offset="1" Color="#e8161616"/>
                                 </LinearGradientBrush>
                              </ListBox.Background>
                           </ListBox>
                        </Border>

                     </Grid>
                  </Border>
               </Border>

            </ControlTemplate>
         </Setter.Value>
      </Setter>
   </Style>
Though I notice that it causes a significant lag when opening the dialog box when typing (around a second or two) rather than the instant appearance if left 'unthemed'. The transparent right-click machine menu seems to load instantly so am I doing something wrong with using the above code or is that about right for doing this sort of thing ? (I've an 8gb 8-core i7 @ 2.2Ghz running win7 )
Last edited by mcbpete on Tue Jul 24, 2012 7:55 pm, edited 2 times in total.

User avatar
strobotone
Posts: 297
Joined: Wed Nov 23, 2011 2:59 pm
Location: berlin
Contact:

Re: Themes, where?

Post by strobotone »

unfortunately that delay is the "normal" behavior.
it seems the reason is the way the machine names get recolored depending on the machine-type in the custom quicknewmachinewindow.
we had a discussion about that issue before. no solution until now, anyone?

User avatar
mcbpete
Posts: 318
Joined: Tue Nov 22, 2011 9:45 pm

Re: Themes, where?

Post by mcbpete »

Ah gotcha, so is the colouring of the machine list (and the xaml <style> definitions in general) done 'on-the-fly' rather than on the booting of the application - So every time you create a new instance of the menu it has to 'work out' all the style definitions again? Is this the nature of .net applications ? (apologies if I sound stupid and this is obvious !)

Thanks for all you info man though, it's been really useful :)

oskari
Site Admin
Posts: 281
Joined: Mon Nov 21, 2011 2:04 pm

Re: Themes, where?

Post by oskari »

It's probably a WPF bug, it shouldn't take that much time. Try some alternative way to do the same thing.

Post Reply