Commit 7bf050f3 authored by Jonathan Wilkes's avatar Jonathan Wilkes
Browse files

added resize_window functions to make the dialog windows adjust to the dialog size

parent e9dd540b
......@@ -2,6 +2,7 @@
<html>
<head>
<link id="page_style" rel="stylesheet" type="text/css" href="css/default.css">
<title>Pd Preferences</title>
</head>
<body>
<div class="container noselect">
......@@ -520,6 +521,16 @@
}
}
function resize_window() {
var w = document.body.scrollWidth,
h = document.body.scrollHeight,
win = pdgui.get_dialogwin(pd_object_callback);
win.width = w;
win.height = h;
}
function populate_array_form(arrays) {
var arrays_select, a_field = document.getElementById('arrays');
var i, opt;
......@@ -586,6 +597,7 @@
// labels and form elements. That makes it more efficient and
// snappier, at least on older machines.
document.getElementsByClassName('container')[0].style.setProperty('display', 'inline');
resize_window();
}
function tr_text(id) {
......
......@@ -479,6 +479,14 @@ function cancel() {
pdgui.pdsend(pd_object_callback + " cancel");
}
function resize_window() {
var w = document.body.scrollWidth,
h = document.body.scrollHeight,
win = pdgui.get_dialogwin(pd_object_callback);
win.width = w;
win.height = h;
}
// This gets called from the nw_create_window function in index.html
// It provides us with our window id from the C side. Once we have it
// we can create the menu and register event callbacks
......@@ -499,6 +507,7 @@ function register_canvas_id(gfxstub, attr_array) {
// labels and form elements. That makes it more efficient and
// snappier, at least on older machines.
document.getElementsByClassName('container')[0].style.setProperty('display', 'inline');
resize_window();
}
function tr_text(id) {
......
......@@ -393,6 +393,15 @@ function cancel() {
//pdgui.pdsend(pd_object_callback + " cancel");
}
function resize_window() {
var w = document.body.scrollWidth,
h = document.body.scrollHeight,
win = pdgui.get_dialogwin(pd_object_callback);
win.width = w;
win.height = h;
pdgui.gui_post("w is " + w + " and h is " + h);
}
function change_api(elem) {
var id = elem.getAttribute('id'),
value = elem.getAttribute('value');
......@@ -515,6 +524,7 @@ function audio_prefs_callback(attrs) {
// have the side-effect of setting the dev to 'None')
set_chans('in', get_attr('pd-inchans', attrs));
set_chans('out', get_attr('pd-outchans', attrs));
resize_window();
}
function set_devs(type, devs) {
......@@ -548,8 +558,7 @@ function midi_prefs_callback(attrs) {
get_attr('current-api', attrs)
);
}
resize_window();
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment