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,34 +158,46 @@ 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()
|
||||||
{
|
{
|
||||||
XElement el = new XElement("layouts");
|
//todo: check if it actually changed ...
|
||||||
foreach (var client in layouts.Keys)
|
try
|
||||||
{
|
{
|
||||||
if (client == "")
|
XElement el = new XElement("layouts");
|
||||||
|
foreach (var client in layouts.Keys)
|
||||||
{
|
{
|
||||||
continue;
|
if (client == "")
|
||||||
}
|
|
||||||
XElement layout = new XElement(client.Replace(" ", "_"));
|
|
||||||
foreach (var thumbnail_ in layouts[client])
|
|
||||||
{
|
|
||||||
String thumbnail = thumbnail_.Key.Replace("-> ", "").Replace(" <-", "").Replace(" ", "_");
|
|
||||||
if (thumbnail == "")
|
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
XElement position = new XElement(thumbnail);
|
XElement layout = new XElement(client.Replace(" ", "_"));
|
||||||
position.Add(new XElement("x", thumbnail_.Value.X));
|
foreach (var thumbnail_ in layouts[client])
|
||||||
position.Add(new XElement("y", thumbnail_.Value.Y));
|
{
|
||||||
layout.Add(position);
|
String thumbnail = thumbnail_.Key.Replace("-> ", "").Replace(" <-", "").Replace(" ", "_");
|
||||||
|
if (thumbnail == "")
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
XElement position = new XElement(thumbnail);
|
||||||
|
position.Add(new XElement("x", thumbnail_.Value.X));
|
||||||
|
position.Add(new XElement("y", thumbnail_.Value.Y));
|
||||||
|
layout.Add(position);
|
||||||
|
}
|
||||||
|
el.Add(layout);
|
||||||
}
|
}
|
||||||
el.Add(layout);
|
|
||||||
}
|
|
||||||
|
|
||||||
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