GUI improvements

This commit is contained in:
Stephan Richter
2020-12-25 19:20:24 +01:00
parent 39a416e964
commit 1694eafc6c
8 changed files with 59 additions and 8 deletions

View File

@@ -348,4 +348,28 @@ svg.preview rect{
svg.Block text{
fill: black;
}
}
.window > .tabs > legend {
float:left;
background: lightgray;
padding: 5px;
border: 1px solid black;
border-radius: 5px 5px 0 0;
margin: 0 3px;
}
.window legend.front{
background: white;
border-bottom-color: white;
position: relative;
z-index: 10;
}
.window fieldset {
position: relative;
top: -1px;
float: none;
clear:both;
border-radius: 0 5px 5px 5px;
}

View File

@@ -31,6 +31,29 @@ function addTile(x,y){
return request({realm:'plan',action:mode,tile:selected.id,x:x,y:y});
}
function arrangeTabs(){
var id = 0;
var tabs = $('<div/>',{'class':'tabs'});
tabs.insertAfter($('.swapbtn'));
$('.window > fieldset > legend').each(function(){
var fs = this.parentNode;
if (!fs.id) fs.id = 'fieldset-'+id;
$(this).appendTo(tabs).click(fs.id,clickLegend);
if (id > 0) {
$(fs).hide();
} else $(this).addClass('front');
id++;
});
}
function clickLegend(ev){
var fieldsetId = ev.data;
$('.window > .tabs > legend').removeClass('front');
$(ev.target).addClass('front');
$('.window > fieldset').hide();
$('#'+fieldsetId).show();
}
function clickTile(x,y){
var id = x+"-"+y;
var tiles = $('#'+id);
@@ -177,6 +200,7 @@ function request(data){
$(BODY).append($(resp));
if (isWindow) {
tileWindow();
arrangeTabs();
var win = $('.window');
if (win.attr('id')==winId) win.scrollTop(scroll);
}

View File

@@ -85,7 +85,7 @@ Direction : Richtung
Direction\: heading {} : Richtung: nach {}
disabled : deaktiviert
disable {} : {} deaktivieren
Disabled routes using this tile : Deaktivierte Routen, die diesen Abschnitt verwenden
disabled routes : deaktivierte Fahrstraßen
Display "{}" on {}. : „{}“ auf {} anzeigen.
Drop : Verwerfen
Dropped destination of {}. : Ziel von {} verworfen.
@@ -130,6 +130,7 @@ Length unit : Längeneinheit
Locked by {} : Durch {} besetzt
Locomotive manager : Lok-Verwaltung
Locomotives\: : Lokomotiven:
Locomotives and cars : Lokomotiven und Waggons
Manage cars : Waggons verwalten
Manage locos : Lokomotiven verwalten
Manage trains : Züge verwalten
@@ -183,6 +184,7 @@ Reversed {}. : {} umgedreht.
RIGHT : rechts
Right port\: : Port für rechts
Route properties : Routen-Eigenschaften
Routes : Fahrstraßen
Routes using this tile : Fahrstraßen, die diesen Abschnitt verwenden
Route will only be available, if all conditions are fulfilled. : Route ist nur verfügbar, wenn alle Bedingungen erfüllt sind.
Save : speichern