buzz forums

forums of the buzz
It is currently Sun Aug 20, 2017 9:01 pm

All times are UTC




Post new topic Reply to topic  [ 48 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
 Post subject: Re: Themes, where?
PostPosted: Wed Mar 21, 2012 10:18 pm 
User avatar

Joined: Thu Mar 01, 2012 6:44 am
Posts: 13
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


Top
 Profile  
 
 Post subject: Re: Themes, where?
PostPosted: Thu Mar 22, 2012 6:43 am 
User avatar

Joined: Wed Nov 23, 2011 2:59 pm
Posts: 297
Location: berlin
interesting. thanks for the tip !


Top
 Profile  
 
 Post subject: Re: Themes, where?
PostPosted: Sun Jul 08, 2012 8:00 am 
User avatar

Joined: Wed Nov 23, 2011 2:59 pm
Posts: 297
Location: berlin
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


Top
 Profile  
 
 Post subject: Re: Themes, where?
PostPosted: Sun Jul 08, 2012 10:55 pm 
User avatar

Joined: Fri Nov 25, 2011 2:55 am
Posts: 10
Location: Uruguay
Thank you very much.


Top
 Profile  
 
 Post subject: Re: Themes, where?
PostPosted: Mon Jul 09, 2012 11:40 pm 
User avatar

Joined: Tue Nov 22, 2011 9:45 pm
Posts: 278
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:
         <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 ?).


Top
 Profile  
 
 Post subject: Re: Themes, where?
PostPosted: Tue Jul 10, 2012 8:19 am 
User avatar

Joined: Wed Nov 23, 2011 2:59 pm
Posts: 297
Location: berlin
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.


Top
 Profile  
 
 Post subject: Re: Themes, where?
PostPosted: Tue Jul 10, 2012 9:56 am 
User avatar

Joined: Tue Nov 22, 2011 9:45 pm
Posts: 278
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 :)


Top
 Profile  
 
 Post subject: Re: Themes, where?
PostPosted: Sun Jul 15, 2012 7:45 pm 
User avatar

Joined: Tue Nov 22, 2011 9:45 pm
Posts: 278
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 ?


Top
 Profile  
 
 Post subject: Re: Themes, where?
PostPosted: Mon Jul 16, 2012 1:01 pm 
User avatar

Joined: Wed Nov 23, 2011 2:59 pm
Posts: 297
Location: berlin
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.


Top
 Profile  
 
 Post subject: Re: Themes, where?
PostPosted: Mon Jul 16, 2012 4:12 pm 
User avatar

Joined: Tue Nov 22, 2011 9:45 pm
Posts: 278
You're a star - I'll have a tinker around this evening !


Top
 Profile  
 
 Post subject: Re: Themes, where?
PostPosted: Mon Jul 16, 2012 8:43 pm 
User avatar

Joined: Wed Nov 23, 2011 2:59 pm
Posts: 297
Location: berlin
feel free to post a screenshot of your theme then :)


Top
 Profile  
 
 Post subject: Re: Themes, where?
PostPosted: Mon Jul 16, 2012 9:16 pm 
User avatar

Joined: Tue Nov 22, 2011 9:45 pm
Posts: 278
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:
    <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.

Top
 Profile  
 
 Post subject: Re: Themes, where?
PostPosted: Thu Jul 19, 2012 9:28 am 
User avatar

Joined: Mon Nov 21, 2011 7:23 pm
Posts: 288
[quote="strobotone"][/quote]

care to comment? :D

(also i got screen grabs info and entry)


Top
 Profile  
 
 Post subject: Re: Themes, where?
PostPosted: Thu Jul 19, 2012 6:50 pm 
User avatar

Joined: Wed Nov 23, 2011 2:59 pm
Posts: 297
Location: berlin
: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.


Top
 Profile  
 
 Post subject: Re: Themes, where?
PostPosted: Thu Jul 19, 2012 7:32 pm 
User avatar

Joined: Mon Nov 21, 2011 7:23 pm
Posts: 288
nah, i was sofascening :) got a fun shock when i saw the title come up. nice logo btw!


Top
 Profile  
 
 Post subject: Re: Themes, where?
PostPosted: Sun Jul 22, 2012 1:18 pm 
User avatar

Joined: Wed Nov 23, 2011 2:59 pm
Posts: 297
Location: berlin
neat. the world is a small place :)


Top
 Profile  
 
 Post subject: Re: Themes, where?
PostPosted: Tue Jul 24, 2012 7:36 pm 
User avatar

Joined: Tue Nov 22, 2011 9:45 pm
Posts: 278
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:

<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.

Top
 Profile  
 
 Post subject: Re: Themes, where?
PostPosted: Tue Jul 24, 2012 7:46 pm 
User avatar

Joined: Wed Nov 23, 2011 2:59 pm
Posts: 297
Location: berlin
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?


Top
 Profile  
 
 Post subject: Re: Themes, where?
PostPosted: Tue Jul 24, 2012 8:03 pm 
User avatar

Joined: Tue Nov 22, 2011 9:45 pm
Posts: 278
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 :)


Top
 Profile  
 
 Post subject: Re: Themes, where?
PostPosted: Tue Jul 24, 2012 8:44 pm 
Site Admin

Joined: Mon Nov 21, 2011 2:04 pm
Posts: 273
It's probably a WPF bug, it shouldn't take that much time. Try some alternative way to do the same thing.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 48 posts ]  Go to page Previous  1, 2, 3  Next

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group