fixed the previews not working nicely in framed window
more restrictive on calls to store_layouts - pending an observeable based solution!
This commit is contained in:
		@@ -158,9 +158,16 @@ namespace PreviewToy
 | 
				
			|||||||
        public void preview_did_switch()
 | 
					        public void preview_did_switch()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            store_layout();
 | 
					            store_layout();
 | 
				
			||||||
 | 
					            foreach (KeyValuePair<IntPtr, Preview> entry in previews)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                entry.Value.TopMost = Properties.Settings.Default.always_on_top;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        private void store_layout()
 | 
					        private void store_layout()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            //todo: check if it actually changed ...
 | 
				
			||||||
 | 
					            try
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                XElement el = new XElement("layouts");
 | 
					                XElement el = new XElement("layouts");
 | 
				
			||||||
                foreach (var client in layouts.Keys)
 | 
					                foreach (var client in layouts.Keys)
 | 
				
			||||||
@@ -187,6 +194,11 @@ namespace PreviewToy
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
                el.Save("layout.xml");
 | 
					                el.Save("layout.xml");
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					            catch
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                //
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        private void handle_unique_layout(Preview preview, String last_known_active_window)
 | 
					        private void handle_unique_layout(Preview preview, String last_known_active_window)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
@@ -289,7 +301,6 @@ namespace PreviewToy
 | 
				
			|||||||
                layouts[active_client_title] = new Dictionary<String, Point>();
 | 
					                layouts[active_client_title] = new Dictionary<String, Point>();
 | 
				
			||||||
                layouts[active_client_title][preview_handle] = position;
 | 
					                layouts[active_client_title][preview_handle] = position;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            store_layout();
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -377,10 +388,7 @@ namespace PreviewToy
 | 
				
			|||||||
        {
 | 
					        {
 | 
				
			||||||
            Properties.Settings.Default.always_on_top = option_always_on_top.Checked;
 | 
					            Properties.Settings.Default.always_on_top = option_always_on_top.Checked;
 | 
				
			||||||
            Properties.Settings.Default.Save();
 | 
					            Properties.Settings.Default.Save();
 | 
				
			||||||
            foreach (var thumbnail in previews)
 | 
					            refresh_thumbnails();
 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                thumbnail.Value.TopMost = Properties.Settings.Default.always_on_top;
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -28,7 +28,7 @@
 | 
				
			|||||||
    <UpdateRequired>false</UpdateRequired>
 | 
					    <UpdateRequired>false</UpdateRequired>
 | 
				
			||||||
    <MapFileExtensions>true</MapFileExtensions>
 | 
					    <MapFileExtensions>true</MapFileExtensions>
 | 
				
			||||||
    <ApplicationRevision>0</ApplicationRevision>
 | 
					    <ApplicationRevision>0</ApplicationRevision>
 | 
				
			||||||
    <ApplicationVersion>1.5.0.0</ApplicationVersion>
 | 
					    <ApplicationVersion>1.6.0.0</ApplicationVersion>
 | 
				
			||||||
    <UseApplicationTrust>false</UseApplicationTrust>
 | 
					    <UseApplicationTrust>false</UseApplicationTrust>
 | 
				
			||||||
    <PublishWizardCompleted>true</PublishWizardCompleted>
 | 
					    <PublishWizardCompleted>true</PublishWizardCompleted>
 | 
				
			||||||
    <BootstrapperEnabled>true</BootstrapperEnabled>
 | 
					    <BootstrapperEnabled>true</BootstrapperEnabled>
 | 
				
			||||||
 
 | 
				
			|||||||
										
											Binary file not shown.
										
									
								
							
		Reference in New Issue
	
	Block a user