Merge pull request #10102 from vladest/tablet-ui-goto

Put current address to location instead of inputfield
This commit is contained in:
Seth Alves 2017-04-03 16:09:58 -07:00 committed by GitHub
commit fbf2014f04
3 changed files with 18 additions and 20 deletions

View file

@ -38,7 +38,7 @@ StackView {
root.currentItem.focus = true;
root.currentItem.forceActiveFocus();
fillDestinations();
updateLocationText();
updateLocationText(false);
root.parentChanged.connect(center);
center();
}
@ -63,8 +63,8 @@ StackView {
root.push(card);
return;
}
addressLine.text = targetString;
toggleOrGo(true);
location.text = targetString;
toggleOrGo(true, targetString);
clearAddressLineTimer.start();
}
@ -539,7 +539,11 @@ StackView {
}
}
function toggleOrGo(fromSuggestions) {
function toggleOrGo(fromSuggestions, address) {
if (address !== undefined && address !== "") {
addressBarDialog.loadAddress(address, fromSuggestions)
}
if (addressLine.text !== "") {
addressBarDialog.loadAddress(addressLine.text, fromSuggestions)
}

View file

@ -89,14 +89,17 @@ Preference {
if (categoryPreferences) {
console.log("Category " + root.name + " with " + categoryPreferences.length + " preferences");
for (var j = 0; j < categoryPreferences.length; ++j) {
buildPreference(categoryPreferences[j]);
//provide component position within column
//lowest numbers on top
buildPreference(categoryPreferences[j], j);
}
}
}
function buildPreference(preference) {
function buildPreference(preference, itemNum) {
console.log("\tPreference type " + preference.type + " name " + preference.name)
var builder;
var zpos;
switch (preference.type) {
case Preference.Editable:
checkBoxCount = 0;
@ -136,11 +139,14 @@ Preference {
case Preference.ComboBox:
checkBoxCount = 0;
builder = comboBoxBuilder;
//make sure that combo boxes sitting higher will have higher z coordinate
//to be not overlapped when drop down is active
zpos = root.z + 1000 - itemNum
break;
};
if (builder) {
preferences.push(builder.createObject(contentContainer, { preference: preference, isFirstCheckBox: (checkBoxCount === 1) }));
preferences.push(builder.createObject(contentContainer, { preference: preference, isFirstCheckBox: (checkBoxCount === 1) , z: zpos}));
}
}
}

View file

@ -5786,22 +5786,10 @@ void Application::toggleRunningScriptsWidget() const {
}
void Application::showScriptLogs() {
auto tabletScriptingInterface = DependencyManager::get<TabletScriptingInterface>();
auto tablet = dynamic_cast<TabletProxy*>(tabletScriptingInterface->getTablet("com.highfidelity.interface.tablet.system"));
auto scriptEngines = DependencyManager::get<ScriptEngines>();
QUrl defaultScriptsLoc = defaultScriptsLocation();
defaultScriptsLoc.setPath(defaultScriptsLoc.path() + "developer/debugging/debugWindow.js");
if (tablet->getToolbarMode()) {
scriptEngines->loadScript(defaultScriptsLoc.toString());
} else {
QQuickItem* tabletRoot = tablet->getTabletRoot();
if (!tabletRoot && !isHMDMode()) {
scriptEngines->loadScript(defaultScriptsLoc.toString());
} else {
tablet->pushOntoStack("../../hifi/dialogs/TabletDebugWindow.qml");
}
}
scriptEngines->loadScript(defaultScriptsLoc.toString());
}
void Application::showAssetServerWidget(QString filePath) {