LoginSignup
1
2

More than 5 years have passed since last update.

Atomのウィンドウサイズ、プロジェクトツリーのサイズを固定する

Last updated at Posted at 2017-08-14

atomに一度開いたフォルダのウィンドウサイズやツリーのサイズは記憶してくれますが、新しく開いた場合サイズをいちいち調節しなくてはなりません。その作業が煩雑なため、自分の好きなデフォルト値で固定できないか調べました。

ウィンドウサイズ

SS 2017-08-14 22.10.33.png
ウィンドウサイズの指定は、atomメニューのInit Script...を選択して自分の設定を書き加えます。単位はピクセルっぽいです。
atomの新しいウィンドウを開くときにこのサイズになるということなので、開いた後でも調整は可能です。

init.coffee
atom.setSize(900, 800)

ツリーの幅

左に表示されるプロジェクトフォルダーのツリーの幅を固定するには、atomメニューのStyles...を選択して自分の設定を書き加えます。
atom-panel-containerleftクラスでプロジェクトツリーの幅を決められるみたいです。max-widthを指定して上限値を設定することで調節しています。(これをやってる記事を見かけないので自分でDeveloperモードからhtmlのソースを読んで見つけた方法ですが、より良い方法があれば教えてください。)
後の.atom-dock-resize-handle.left.atom-dock-resize-handle-resizableというのはツリーパネルの幅を調整するものですが、すでにmax-widthを指定しているので狭くしか調整できません。いらないので0pxにして調整できなくしました。こちらはお好みでどうぞ。

styles.less
atom-panel-container .left {
    max-width: 100px !important;
}
.atom-dock-resize-handle.left.atom-dock-resize-handle-resizable {
    width: 0px;
}


参照
Atom doesn't remember the window size

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2