Skip to content

Commit

Permalink
Rename preference numblock to numpad.
Browse files Browse the repository at this point in the history
  • Loading branch information
Olaf Schulz committed Oct 17, 2011
1 parent 083932a commit 7a7bc40
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
5 changes: 3 additions & 2 deletions src/config-manager.vala
Expand Up @@ -49,15 +49,16 @@ namespace NeoLayoutViewer{
addSetting("move_shortcut","<Ctrl><Alt>N", "Circle the window posisition");
//addSetting("position_cycle","3 3 9 1 3 9 1 7 7", "List of positions (num pad orientation)");
addSetting("position_cycle","2 3 6 1 3 9 4 7 8", "List of positions (num pad orientation)");
addSetting("display_numblock","1", null);
addSetting("display_numpad","1", null);
addSetting("display_function_keys","1", null);
addSetting("window_selectable","1","To use the keyboard window as virtual keyboard, disable this entry.");
}

/*
Einstellungen, die der Übersicht halber nicht in der Konfigurationsdatei stehen.
*/
private void add_intern_values(){
config.set("numblock_width","350");
config.set("numpad_width","350");

}

Expand Down
14 changes: 7 additions & 7 deletions src/key-overlay.vala
Expand Up @@ -308,8 +308,8 @@ namespace NeoLayoutViewer{

double winWidthUnscaled = 1000.0;
double winHeightUnscaled = 220.0;
if( winMain.config.get("display_numblock")=="0" )
winWidthUnscaled -= winMain.numblock_width;
if( winMain.config.get("display_numpad")=="0" )
winWidthUnscaled -= winMain.numpad_width;
int width, height;
winMain.get_size2(out width, out height);

Expand Down Expand Up @@ -338,7 +338,7 @@ namespace NeoLayoutViewer{
scaledBox(44.0,44.0,ref posXUnscaled, ref posYUnscaled, ref posX, ref posY, scaleX, scaleY , 20, false, winMain, hboxes[0], 0);
scaledBox(44.0,44.0,ref posXUnscaled, ref posYUnscaled, ref posX, ref posY, scaleX, scaleY , 21 , false, winMain, hboxes[0], 0);

if( winMain.config.get("display_numblock")!="0" ){
if( winMain.config.get("display_numpad")!="0" ){
scaledBox(78.0-1.0,44.0,ref posXUnscaled, ref posYUnscaled, ref posX, ref posY, scaleX, scaleY , 22 , false, winMain, hboxes[0], 0);
//free space
scaledBox(22.0,44.0,ref posXUnscaled, ref posYUnscaled, ref posX, ref posY, scaleX, scaleY , -1 , false, winMain, hboxes[0], 3);
Expand Down Expand Up @@ -375,7 +375,7 @@ namespace NeoLayoutViewer{
scaledBox(44.0,44.0,ref posXUnscaled, ref posYUnscaled, ref posX, ref posY, scaleX, scaleY , 34 , false, winMain, hboxes[1], 0);
scaledBox(44.0,44.0,ref posXUnscaled, ref posYUnscaled, ref posX, ref posY, scaleX, scaleY , 35 , false, winMain, hboxes[1], 0);

if( winMain.config.get("display_numblock")!="0" ){
if( winMain.config.get("display_numpad")!="0" ){
//Halve of Return/Enter
scaledBox(62.0-1,44.0,ref posXUnscaled, ref posYUnscaled, ref posX, ref posY, scaleX, scaleY , 36 , false, winMain, hboxes[1], 0);
//free space
Expand Down Expand Up @@ -418,7 +418,7 @@ namespace NeoLayoutViewer{
//right mod3
scaledBox(44.0,44.0,ref posXUnscaled, ref posYUnscaled, ref posX, ref posY, scaleX, scaleY , 2/*51*/ , false, winMain, hboxes[2], 1);

if( winMain.config.get("display_numblock")!="0" ){
if( winMain.config.get("display_numpad")!="0" ){
//Second halve of Enter/Return
scaledBox(49.0-1,44.0,ref posXUnscaled, ref posYUnscaled, ref posX, ref posY, scaleX, scaleY , 36 , false, winMain, hboxes[2], 0);
//free space
Expand Down Expand Up @@ -452,7 +452,7 @@ namespace NeoLayoutViewer{
scaledBox(44.0,44.0,ref posXUnscaled, ref posYUnscaled, ref posX, ref posY, scaleX, scaleY , 59 , false, winMain, hboxes[3], 0);
scaledBox(44.0,44.0,ref posXUnscaled, ref posYUnscaled, ref posX, ref posY, scaleX, scaleY , 60 , false, winMain, hboxes[3], 0);
scaledBox(44.0,44.0,ref posXUnscaled, ref posYUnscaled, ref posX, ref posY, scaleX, scaleY , 61 , false, winMain, hboxes[3], 0);
if( winMain.config.get("display_numblock")!="0" ){
if( winMain.config.get("display_numpad")!="0" ){
//right shift
scaledBox(114.0-1,44.0,ref posXUnscaled, ref posYUnscaled, ref posX, ref posY, scaleX, scaleY , 1 /*62*/ , false, winMain, hboxes[3], 1);
//free space
Expand Down Expand Up @@ -488,7 +488,7 @@ namespace NeoLayoutViewer{
//free space
scaledBox(40.0,44.0,ref posXUnscaled, ref posYUnscaled, ref posX, ref posY, scaleX, scaleY , -1 , false, winMain, hboxes[4], 3);

if( winMain.config.get("display_numblock")!="0" ){
if( winMain.config.get("display_numpad")!="0" ){
// right ctrl
scaledBox(61.0,44.0,ref posXUnscaled, ref posYUnscaled, ref posX, ref posY, scaleX, scaleY , 4/*105*/ , false, winMain, hboxes[4], 2);
//free space
Expand Down
12 changes: 6 additions & 6 deletions src/neo-window.vala
Expand Up @@ -15,7 +15,7 @@ namespace NeoLayoutViewer{
public int ebene;
public int[] active_modifier_by_keyboard;
public int[] active_modifier_by_mouse;
public int numblock_width;
public int numpad_width;
//private Button button;
private bool minimized;
private int position_num;
Expand Down Expand Up @@ -129,8 +129,8 @@ namespace NeoLayoutViewer{
int width;
int height;
this.get_size2(out width, out height);
//bad position, if numblock not shown...
fixed.put( status, (int) ( (0.65)*width), (int) (0.40*height) );
//bad position, if numpad not shown...
fixed.put( status, (int) ( (0.66)*width), (int) (0.40*height) );

//Fenstereigenschaften setzen
this.key_press_event.connect (on_key_pressed);
Expand Down Expand Up @@ -274,9 +274,9 @@ namespace NeoLayoutViewer{
this.image_buffer[i] = open_image(i);

//Numpad-Teil abschneiden, falls gefordert
this.numblock_width = int.parse(config.get("numblock_width"));
if( config.get("display_numblock")=="0" ){
var tmp = new Gdk.Pixbuf(image_buffer[i].colorspace,image_buffer[i].has_alpha,image_buffer[i].bits_per_sample, image_buffer[i].width-numblock_width ,image_buffer[i].height);
this.numpad_width = int.parse(config.get("numpad_width"));
if( config.get("display_numpad")=="0" ){
var tmp = new Gdk.Pixbuf(image_buffer[i].colorspace,image_buffer[i].has_alpha,image_buffer[i].bits_per_sample, image_buffer[i].width-numpad_width ,image_buffer[i].height);
this.image_buffer[i].copy_area(0,0,tmp.width,tmp.height,tmp,0,0);
this.image_buffer[i] = tmp;
}
Expand Down

0 comments on commit 7a7bc40

Please sign in to comment.