summaryrefslogtreecommitdiffstats
path: root/src/gui/WindowFactory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/WindowFactory.cpp')
-rw-r--r--src/gui/WindowFactory.cpp28
1 files changed, 13 insertions, 15 deletions
diff --git a/src/gui/WindowFactory.cpp b/src/gui/WindowFactory.cpp
index 8928b664..78acf4fb 100644
--- a/src/gui/WindowFactory.cpp
+++ b/src/gui/WindowFactory.cpp
@@ -1,6 +1,6 @@
/*
This file is part of Ingen.
- Copyright 2007-2015 David Robillard <http://drobilla.net/>
+ Copyright 2007-2024 David Robillard <http://drobilla.net/>
Ingen is free software: you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License as published by the Free
@@ -26,16 +26,17 @@
#include "RenameWindow.hpp"
#include "WidgetFactory.hpp"
-#include "ingen/Log.hpp"
-#include "ingen/client/BlockModel.hpp"
-#include "ingen/client/GraphModel.hpp"
-#include "ingen/client/ObjectModel.hpp"
+#include <ingen/Log.hpp>
+#include <ingen/client/BlockModel.hpp>
+#include <ingen/client/GraphModel.hpp>
+#include <ingen/client/ObjectModel.hpp>
+#include <raul/Path.hpp>
#include <gdkmm/window.h>
-#include <glibmm/signalproxy.h>
#include <sigc++/adaptors/bind.h>
#include <sigc++/functors/mem_fun.h>
+#include <algorithm>
#include <cassert>
#include <memory>
#include <stdexcept>
@@ -44,6 +45,8 @@
namespace ingen {
+class Properties;
+
using client::BlockModel;
using client::GraphModel;
using client::ObjectModel;
@@ -93,14 +96,9 @@ WindowFactory::clear()
size_t
WindowFactory::num_open_graph_windows()
{
- size_t ret = 0;
- for (const auto& w : _graph_windows) {
- if (w.second->is_visible()) {
- ++ret;
- }
- }
-
- return ret;
+ return std::count_if(_graph_windows.begin(),
+ _graph_windows.end(),
+ [](const auto& w) { return w.second->is_visible(); });
}
GraphBox*
@@ -226,7 +224,7 @@ WindowFactory::present_load_plugin(
int width = 0;
int height = 0;
w->second->get_size(width, height);
- _load_plugin_win->set_default_size(width - width / 8, height / 2);
+ _load_plugin_win->set_default_size(width - (width / 8), height / 2);
}
_load_plugin_win->set_title(
std::string("Load Plugin - ") + graph->path() + " - Ingen");