Skip to content

Commit

Permalink
NGEx・置換の条件欄がウィンドウサイズに応じて広がるようにした closes #132
Browse files Browse the repository at this point in the history
  • Loading branch information
nodaguti committed Nov 9, 2014
1 parent 865a414 commit 7ae5258
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

<xul:groupbox flex="1">
<xul:caption label="条件" />
<xul:vbox class="rule-editor"
<xul:vbox class="rule-editor" flex="1"
style="-moz-binding: url(chrome://chaika/content/settings/rule-editor.xml#editor)" />
</xul:groupbox>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
onunload="shutdown()"
persist="screenX screenY width height">

<vbox id="ngex-editor"></vbox>
<vbox id="ngex-editor" flex="1"></vbox>

<script type="application/javascript; version=1.7"
src="chrome://chaika/content/settings/abone-manager-ngex-new.js"/>
Expand Down
2 changes: 1 addition & 1 deletion chaika/chrome/content/chaika/settings/abone-manager.xul
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
<button label="削除" class="button-remove" />
</hbox>

<vbox id="ngex-editor"></vbox>
<vbox id="ngex-editor" flex="1"></vbox>
</tabpanel>
</tabpanels>
</tabbox>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

<xul:groupbox flex="1">
<xul:caption label="条件" tooltiptext="空欄にすると条件を未設定にできます" />
<xul:vbox class="rule-editor"
<xul:vbox class="rule-editor" flex="1"
style="-moz-binding: url(chrome://chaika/content/settings/rule-editor.xml#editor)" />
</xul:groupbox>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
onunload="shutdown()"
persist="screenX screenY width height">

<vbox id="editor"></vbox>
<vbox id="editor" flex="1"></vbox>

<script type="application/javascript; version=1.7"
src="chrome://chaika/content/settings/replacement-manager-new.js"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<button label="削除" class="button-remove" />
</hbox>

<vbox id="editor"></vbox>
<vbox id="editor" flex="1"></vbox>

<script type="application/javascript; version=1.7"
src="chrome://chaika/content/settings/replacement-manager.js"/>
Expand Down
37 changes: 0 additions & 37 deletions chaika/chrome/content/chaika/settings/rule-editor.xml
Original file line number Diff line number Diff line change
Expand Up @@ -122,43 +122,6 @@

<method name="adjustWindowSize">
<body><![CDATA[
let rules = this._root.querySelector('.rules');
//ディスプレイ高さの7.5割以上の高さになったら、
//そこでウィンドウサイズを大きくするのはやめて、
//かわりにルール表示部にスクロールバーを表示する
if(window.outerHeight > window.screen.availHeight * 0.75){
window.resizeTo(window.outerWidth, window.screen.availHeight * 0.75);
if(!rules.classList.contains('fixed-height')){
rules.classList.add('fixed-height');
rules.style.height = Math.floor(rules.clientHeight) + 'px';
}
}
//ルール表示部の下部にまだ余裕がある場合には、
//ルール表示部の固定高さ表示を解除する
let lastRule = rules.querySelector('.rule:last-child');
let rulesBottomMargin = rules.getBoundingClientRect().bottom -
lastRule.getBoundingClientRect().bottom;
if(rulesBottomMargin > 0){
rules.classList.remove('fixed-height');
rules.style.height = 'auto';
}
//条件を削除するなどして content のサイズが小さくなった場合に
//ウィンドウ下部の空白部分が広がってしまう問題に対処する
let windowBottomMargin = document.documentElement.getBoundingClientRect().bottom -
this.getBoundingClientRect().bottom;
if(windowBottomMargin > 0){
window.resizeBy(0, -windowBottomMargin);
}
//条件を追加したときにウィンドウサイズが広がらず、
//下部が見切れてしまう問題に対処する
//ウィンドウの再描画がうまく行われないことが原因?
Expand Down
4 changes: 0 additions & 4 deletions chaika/chrome/skin/classic/chaika/settings/rule-editor.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,3 @@
.template{
display: none;
}

.fixed-height{
overflow: auto;
}

0 comments on commit 7ae5258

Please sign in to comment.