Page 2 of 3

Re: Themes, where?

Posted: Wed Mar 21, 2012 10:18 pm
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

Re: Themes, where?

Posted: Thu Mar 22, 2012 6:43 am
by strobotone
interesting. thanks for the tip !

Re: Themes, where?

Posted: Sun Jul 08, 2012 8:00 am
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

Re: Themes, where?

Posted: Sun Jul 08, 2012 10:55 pm
by outsider
Thank you very much.

Re: Themes, where?

Posted: Mon Jul 09, 2012 11:40 pm
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 ?).

Re: Themes, where?

Posted: Tue Jul 10, 2012 8:19 am
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.

Re: Themes, where?

Posted: Tue Jul 10, 2012 9:56 am
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 :)

Re: Themes, where?

Posted: Sun Jul 15, 2012 7:45 pm
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 ?

Re: Themes, where?

Posted: Mon Jul 16, 2012 1:01 pm
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.

Re: Themes, where?

Posted: Mon Jul 16, 2012 4:12 pm
by mcbpete
You're a star - I'll have a tinker around this evening !

Re: Themes, where?

Posted: Mon Jul 16, 2012 8:43 pm
by strobotone
feel free to post a screenshot of your theme then :)

Re: Themes, where?

Posted: Mon Jul 16, 2012 9:16 pm
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

Re: Themes, where?

Posted: Thu Jul 19, 2012 9:28 am
by mantratronic
[quote="strobotone"][/quote]

care to comment? :D

(also i got screen grabs info and entry)

Re: Themes, where?

Posted: Thu Jul 19, 2012 6:50 pm
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.

Re: Themes, where?

Posted: Thu Jul 19, 2012 7:32 pm
by mantratronic
nah, i was sofascening :) got a fun shock when i saw the title come up. nice logo btw!

Re: Themes, where?

Posted: Sun Jul 22, 2012 1:18 pm
by strobotone
neat. the world is a small place :)

Re: Themes, where?

Posted: Tue Jul 24, 2012 7:36 pm
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 )

Re: Themes, where?

Posted: Tue Jul 24, 2012 7:46 pm
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?

Re: Themes, where?

Posted: Tue Jul 24, 2012 8:03 pm
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 :)

Re: Themes, where?

Posted: Tue Jul 24, 2012 8:44 pm
by oskari
It's probably a WPF bug, it shouldn't take that much time. Try some alternative way to do the same thing.